Jump to content
  • Advertisement
Sign in to follow this  
Vexator

eye and up vectors from view matrix

This topic is 3661 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
assuming the following matrix layout:

m11 m21 m31 m41
m12 m22 m32 m42
m13 m23 m33 m43
m14 m24 m34 m44

You get the up vector from the view matrix like this:

up = (m12, m22, m32)

For the position/eye vector you need the inverse view matrix and then it's
eye = (m41, m42, m43)

Share this post


Link to post
Share on other sites
mh but position != eye vector, isn't it? in my matrix class, translation is stored in m14, m24, m34. if the camera looks along the negative z-axis, then the up vector should be (0, 1, 0) and the view vector (0, 0, -1), right? with your suggestion, however, the view vector is (0, 0, 0).. any idea what's wrong?
thanks!


[Edited by - Vexator on June 15, 2008 3:06:32 PM]

Share this post


Link to post
Share on other sites
No, eye = position of camera. What you talk of is the lookAt vector or the looking direction. The eye-vector (0,0,0) is the default camera position.

Share this post


Link to post
Share on other sites
ok sry, so what i need then is the lookAt-vector.. how would i get that? m13, m23, m33?

[Edited by - Vexator on June 15, 2008 5:08:33 PM]

Share this post


Link to post
Share on other sites
Only problem is that most people say look-at and mean a point (position + view_direction). Getting just the direction from the matrix is simple (as above).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!