1
\$\begingroup\$

When I do a GluLookAt(0.0, 500.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0) so that I'm 500 units up on the positive Y axis looking down at the origin with the top vector of the camera pointing toward the negative Z axis, that means my unit vector, mathematically speaking, should be (0.0, -1.0, 0.0) correct? If I'm looking down toward the negative Y axis now and want to move closer to the origin, I'm supposed to subtract the number of units from my camera's current position of 500 so that the Y value gets smaller which means I'm moving the camera forward in the direction I'm pointing. How come when I do a glGetFloatv(GL_MODELVIEW_MATRIX, mycopy) to get the current matrix right after the GluLookAt command is executed, I end up getting a Look Vector of (0.0, 1.0, 0.0) so that it's a positive Y value? mycopy[2], mycopy[6] and mycopy[10] are the look vector values. I know I can negate it to get the negative Y value but it seems like a cheap move. Why does OpenGL do this in the modelview matrix when REAL mathematics states that it should be a negative Y value for the look vector? If anyone can help me understand this, I would greatly appreciate it. :)

\$\endgroup\$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.