Jump to content
  • Advertisement
Sign in to follow this  
lukesmith123

Calculate camera vectors with dotproduct

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

I was looking at the sourcecode for a camera class where the view matrix was created a little differently to how I was used to, probably because It doesnt use any createlookat type helper functions.

In this code the look vector, up vector, and right vector were calculated for the view which I understand.

but then the dotProducts between the position of the camera and each of the vectors was calculated and used in the fourth row of each column.

Does anybody know of a resource that explains the maths behind this step? I understand whats happening but I dont understand why.

Also the elements in the fourth column are all set to 0 accept the last one which is 1.0 does anybody know what this is used for?


Thanks so much.


EDIT: In case its relevant the code uses Directx

Share this post


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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!