Editing User:Hg200
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 39: | Line 39: | ||
// 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" | ||
Matrix x_view = xform_matrix (); | Matrix x_view = xform_matrix (); | ||
// | // #7 -> #8 | ||
scale (x_view, 1, 1, -1); | scale (x_view, 1, 1, -1); | ||
Matrix l = xform_matrix (); | Matrix l = xform_matrix (); | ||
Line 47: | Line 46: | ||
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) | ||
x_view = x_view * l; | x_view = x_view * l; | ||
// | // #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 | ||
scale (x_view, pb(0), pb(1), pb(2)); | scale (x_view, pb(0), pb(1), pb(2)); | ||
// | // #3 -> #4 | ||
translate (x_view, -0.5, -0.5, -0.5); | translate (x_view, -0.5, -0.5, -0.5); | ||
</syntaxhighlight>}} | </syntaxhighlight>}} |