Acceptable implementation of Geometry view, but graphics to be improved.

This commit is contained in:
brunoherbelin
2020-05-16 22:18:19 +02:00
parent 610e68c697
commit 61896fdf53
3 changed files with 207 additions and 1050 deletions

View File

@@ -421,12 +421,13 @@ void Frame::draw(glm::mat4 modelview, glm::mat4 projection)
if ( visible_ ) {
// enable antialiasing
glEnable(GL_MULTISAMPLE_ARB);
// shadow
if(shadow_)
shadow_->draw( modelview * transform_, projection);
// enable antialiasing
glEnable(GL_MULTISAMPLE_ARB);
// right side
float ar = scale_.x / scale_.y;
@@ -443,7 +444,7 @@ void Frame::draw(glm::mat4 modelview, glm::mat4 projection)
t.x = -t.x;
s.x = -s.x;
ctm = modelview * GlmToolkit::transform(t, rotation_, s);
// border_->draw( ctm, projection );
border_->draw( ctm, projection );
}
// enable antialiasing
@@ -487,12 +488,28 @@ void Handles::draw(glm::mat4 modelview, glm::mat4 projection)
// set color
handle_->shader()->color = color;
float ar = scale_.x / scale_.y;
float ar = 1.f;//scale_.x / scale_.y;
glm::mat4 ctm;
glm::vec4 center = modelview * glm::vec4(0.f, 0.f, 0.f, 1.f);
glm::vec4 h = modelview * glm::vec4(1.f, 0.f, 0.f, 1.f);
// glm::vec3 scale = glm::normalize( diagonal - center );
glm::mat4 S = glm::scale(glm::identity<glm::mat4>(), glm::vec3( 1.f / h.x, 1.f / h.y, 1.f) );
// glm::vec4 t(1.f, 0.f, 0.f, 1.f);
// t = modelview * t;
// glm::mat4 S = glm::scale(glm::identity<glm::mat4>(), glm::vec3(1.f, 1.f, 1.f) );
if ( type_ == RESIZE ) {
// 4 corners
ctm = modelview * glm::translate(glm::identity<glm::mat4>(), glm::vec3(ar, -1.f, 0.f) );
ctm = modelview * glm::translate(glm::identity<glm::mat4>(), glm::vec3(1.f, -1.f, 0.f) ) ;
// ctm *= S;
// glm::vec4 P = glm::inverse(modelview) * glm::vec4(1.f, 1.f, 0.f, 1.f );
// ctm = glm::translate(glm::identity<glm::mat4>(), glm::vec3(t) );
handle_->draw( ctm, projection );

File diff suppressed because it is too large Load Diff

View File

@@ -12,70 +12,70 @@ property uchar alpha
element face 80
property list uchar uint vertex_indices
end_header
-0.122371 1.059774 0.000000 255 255 255 255
-0.102365 1.279800 0.000000 255 255 255 255
-0.122371 1.279800 0.000000 255 255 255 255
-0.102365 1.259798 0.000000 255 255 255 255
-0.082358 1.259798 0.000000 255 255 255 255
-0.062351 1.279800 0.000000 255 255 255 255
-0.082358 1.279800 0.000000 255 255 255 255
-0.062351 1.239795 0.000000 255 255 255 255
0.057688 1.239795 0.000000 255 255 255 255
0.077695 1.279800 0.000000 255 255 255 255
0.057688 1.279800 0.000000 255 255 255 255
0.077695 1.259798 0.000000 255 255 255 255
0.097701 1.259798 0.000000 255 255 255 255
0.117708 1.279800 0.000000 255 255 255 255
0.097701 1.279800 0.000000 255 255 255 255
0.117708 1.059774 0.000000 255 255 255 255
-0.102365 1.239795 0.000000 255 255 255 255
0.077695 1.239795 0.000000 255 255 255 255
0.097701 1.239795 0.000000 255 255 255 255
-0.102365 1.219793 0.000000 255 255 255 255
-0.082358 1.239795 0.000000 255 255 255 255
-0.082358 1.219793 0.000000 255 255 255 255
0.077695 1.219793 0.000000 255 255 255 255
0.097701 1.219793 0.000000 255 255 255 255
-0.102365 1.199791 0.000000 255 255 255 255
-0.062351 1.209792 0.000000 255 255 255 255
0.057688 1.209792 0.000000 255 255 255 255
0.097701 1.199791 0.000000 255 255 255 255
-0.082358 1.199791 0.000000 255 255 255 255
-0.062351 1.129782 0.000000 255 255 255 255
0.057688 1.129782 0.000000 255 255 255 255
0.077695 1.199791 0.000000 255 255 255 255
-0.102365 1.179788 0.000000 255 255 255 255
-0.082358 1.179788 0.000000 255 255 255 255
0.077695 1.179788 0.000000 255 255 255 255
0.097701 1.179788 0.000000 255 255 255 255
-0.102365 1.159786 0.000000 255 255 255 255
-0.082358 1.159786 0.000000 255 255 255 255
0.077695 1.159786 0.000000 255 255 255 255
0.097701 1.159786 0.000000 255 255 255 255
-0.102365 1.139784 0.000000 255 255 255 255
-0.082358 1.139784 0.000000 255 255 255 255
0.077695 1.139784 0.000000 255 255 255 255
0.097701 1.139784 0.000000 255 255 255 255
-0.102365 1.119781 0.000000 255 255 255 255
0.097701 1.119781 0.000000 255 255 255 255
-0.102365 1.099779 0.000000 255 255 255 255
-0.082358 1.119781 0.000000 255 255 255 255
-0.082358 1.099779 0.000000 255 255 255 255
0.077695 1.119781 0.000000 255 255 255 255
0.077695 1.099779 0.000000 255 255 255 255
0.097701 1.099779 0.000000 255 255 255 255
-0.102365 1.079776 0.000000 255 255 255 255
-0.062351 1.099779 0.000000 255 255 255 255
-0.082358 1.079776 0.000000 255 255 255 255
-0.062351 1.059774 0.000000 255 255 255 255
0.057688 1.099779 0.000000 255 255 255 255
0.057688 1.059774 0.000000 255 255 255 255
0.077695 1.079776 0.000000 255 255 255 255
0.097701 1.079776 0.000000 255 255 255 255
-0.102365 1.059774 0.000000 255 255 255 255
-0.082358 1.059774 0.000000 255 255 255 255
0.077695 1.059774 0.000000 255 255 255 255
0.097701 1.059774 0.000000 255 255 255 255
-0.119887 1.034463 0.000000 255 255 255 255
-0.099881 1.254489 0.000000 255 255 255 255
-0.119887 1.254489 0.000000 255 255 255 255
-0.099881 1.234487 0.000000 255 255 255 255
-0.079874 1.234487 0.000000 255 255 255 255
-0.059867 1.254489 0.000000 255 255 255 255
-0.079874 1.254489 0.000000 255 255 255 255
-0.059867 1.214485 0.000000 255 255 255 255
0.060172 1.214485 0.000000 255 255 255 255
0.080179 1.254489 0.000000 255 255 255 255
0.060172 1.254489 0.000000 255 255 255 255
0.080179 1.234487 0.000000 255 255 255 255
0.100185 1.234487 0.000000 255 255 255 255
0.120192 1.254489 0.000000 255 255 255 255
0.100185 1.254489 0.000000 255 255 255 255
0.120192 1.034463 0.000000 255 255 255 255
-0.099881 1.214485 0.000000 255 255 255 255
0.080179 1.214485 0.000000 255 255 255 255
0.100185 1.214485 0.000000 255 255 255 255
-0.099881 1.194482 0.000000 255 255 255 255
-0.079874 1.214485 0.000000 255 255 255 255
-0.079874 1.194482 0.000000 255 255 255 255
0.080179 1.194482 0.000000 255 255 255 255
0.100185 1.194482 0.000000 255 255 255 255
-0.099881 1.174480 0.000000 255 255 255 255
-0.059867 1.184481 0.000000 255 255 255 255
0.060172 1.184481 0.000000 255 255 255 255
0.100185 1.174480 0.000000 255 255 255 255
-0.079874 1.174480 0.000000 255 255 255 255
-0.059867 1.104472 0.000000 255 255 255 255
0.060172 1.104472 0.000000 255 255 255 255
0.080179 1.174480 0.000000 255 255 255 255
-0.099881 1.154478 0.000000 255 255 255 255
-0.079874 1.154478 0.000000 255 255 255 255
0.080179 1.154478 0.000000 255 255 255 255
0.100185 1.154478 0.000000 255 255 255 255
-0.099881 1.134475 0.000000 255 255 255 255
-0.079874 1.134475 0.000000 255 255 255 255
0.080179 1.134475 0.000000 255 255 255 255
0.100185 1.134475 0.000000 255 255 255 255
-0.099881 1.114473 0.000000 255 255 255 255
-0.079874 1.114473 0.000000 255 255 255 255
0.080179 1.114473 0.000000 255 255 255 255
0.100185 1.114473 0.000000 255 255 255 255
-0.099881 1.094470 0.000000 255 255 255 255
0.100185 1.094470 0.000000 255 255 255 255
-0.099881 1.074468 0.000000 255 255 255 255
-0.079874 1.094470 0.000000 255 255 255 255
-0.079874 1.074468 0.000000 255 255 255 255
0.080179 1.094470 0.000000 255 255 255 255
0.080179 1.074468 0.000000 255 255 255 255
0.100185 1.074468 0.000000 255 255 255 255
-0.099881 1.054466 0.000000 255 255 255 255
-0.059867 1.074468 0.000000 255 255 255 255
-0.079874 1.054466 0.000000 255 255 255 255
-0.059867 1.034463 0.000000 255 255 255 255
0.060172 1.074468 0.000000 255 255 255 255
0.060172 1.034463 0.000000 255 255 255 255
0.080179 1.054466 0.000000 255 255 255 255
0.100185 1.054466 0.000000 255 255 255 255
-0.099881 1.034463 0.000000 255 255 255 255
-0.079874 1.034463 0.000000 255 255 255 255
0.080179 1.034463 0.000000 255 255 255 255
0.100185 1.034463 0.000000 255 255 255 255
3 0 1 2
3 0 3 1
3 4 5 6