Jump to content
  • Advertisement
Sign in to follow this  
hbdivers2

Viewing matrix from eye and traget points

This topic is 2603 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

Hello everybody,

Is there any way I can constrcut the up or the right vector for a viewing matrix, when I only know the eye and target points ?

Thank you in advance

Share this post


Link to post
Share on other sites
Advertisement

Hello everybody,

Is there any way I can constrcut the up or the right vector for a viewing matrix, when I only know the eye and target points ?

Thank you in advance




no, unless you can constrain the camera x vector to the ZX plane(or another plane) in world space, in which case you can use up = y = [0,1,0]( or the normal to your chosen plane)

Share this post


Link to post
Share on other sites

Hello everybody,

Is there any way I can constrcut the up or the right vector for a viewing matrix, when I only know the eye and target points ?

Thank you in advance


If you have an eye point and a target point, you can do targetDirection = target - eye to obtain the direction you want to be looking at. Then, with some choices for conventions, you can create a LookAt matrix to do the job. This is effectively the same as reconstructing an orthonormal basis, given one target vector, and a hint vector (worldUp) on how to reconstruct the up and right directions. See also this thread.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!