How to use the lookAt function?
843799May 26 2009 — edited Jun 13 2009Hi everybody...
I wrote a topic few weeks ago about a problem using two axis rotations I didn't solve... :( I tried another way to move my camera : using the lookAt function of the Transform3D. At first, I thought it would only be a launcher for the glu_LookAt of JOGL but the function does calculate a specific matrix I saw in the Java documentation. My question is really simple, I don't know how to use it! I made a lot of attempts without any success...
We all agree to say that, at first, the X axis points on the right, the Y axis at the top and the Z axis points to the "user".. (right hand using).
For example, I'd like to move in 2D (on X and Z axis). So I set my upVector at (0,1,0), the viewPoint at (0,0,0) and my eyePoint values on X and Z but without any Y value. It works quite good but the repere is inverted (the X and Z axis point on the opposite way, Z points at the background) and my camera doesn't look at the point (0,0,0) everytime... I don't understand why.
Does anyone knows where my problem comes froms?
Thanks!