PDA

View Full Version : eye and up vector from view matrix



Vexator
06-14-2008, 08:16 AM
how do i extract the eye and up vectors from a view matrix?

thanks!

LangFox
06-15-2008, 09:52 PM
http://www.opengl.org/sdk/docs/man/
Check gluLookAt.

Ido_Ilan
06-15-2008, 11:41 PM
Hi,
If your modelview matrix is:

m0 m4 m8 m12
m1 m5 m9 m13
m2 m6 m10 m14
m3 m7 m11 m15

then:

(m0,m1,m2): X-Model in View coord.
(m4,m5,m6): Y-Model in View coord.
(m8,m9,m10): Z-Model in View coord.

(m0,m4,m8): X-View in Model coord.
(m1,m5,m9): Y-View in Model coord.
(m2,m6,m10): Z-View in Model coord.

Ido