User:Hg200: Difference between revisions

Jump to navigation Jump to search
91 bytes added ,  20 September 2020
no edit summary
(Created page with "= Investigations on update_camera() = In the second part of <math display="inline">\rightarrow</math> axes::properties::update_camera () the view transformation "x_gl_mat1" a...")
 
No edit summary
Line 25: Line 25:
    
    
   // Construct a 4x4 matrix "x_view" that is a subset of "x_gl_mat1"
   // Construct a 4x4 matrix "x_view" that is a subset of "x_gl_mat1"
  // Start with identity I = [1,0,0,0; 0,1,0,0; 0,0,1,0; 0,0,0,1]
   Matrix x_view = xform_matrix ();
   Matrix x_view = xform_matrix ();
   // #7 -> #8
   // Step #7 -> #8
   scale (x_view, 1, 1, -1);
   scale (x_view, 1, 1, -1);
   Matrix l = xform_matrix ();
   Matrix l = xform_matrix ();
Line 32: Line 33:
   l(1,0) = u(0); l(1,1) = u(1); l(1,2) = u(2);
   l(1,0) = u(0); l(1,1) = u(1); l(1,2) = u(2);
   l(2,0) = -f(0); l(2,1) = -f(1); l(2,2) = -f(2);
   l(2,0) = -f(0); l(2,1) = -f(1); l(2,2) = -f(2);
   // #6 -> #7 (rotate on the Z axis)
   // Step #6 -> #7 (rotate on the Z axis)
   x_view = x_view * l;
   x_view = x_view * l;
   // #5 -> #6
   // Step #5 -> #6
   translate (x_view, -c_eye(0), -c_eye(1), -c_eye(2));
   translate (x_view, -c_eye(0), -c_eye(1), -c_eye(2));
   // #4 -> #5
   // Step #4 -> #5
   scale (x_view, pb(0), pb(1), pb(2));
   scale (x_view, pb(0), pb(1), pb(2));
   // #3 -> #4
   // Step #3 -> #4
   translate (x_view, -0.5, -0.5, -0.5);
   translate (x_view, -0.5, -0.5, -0.5);
</syntaxhighlight>}}
</syntaxhighlight>}}
20

edits

Navigation menu