Jump to content
  • Advertisement
Sign in to follow this  

Calculate camera vectors with dotproduct

This topic is 2955 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
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!