Jump to content
  • Advertisement
Sign in to follow this  
EternityZA

[GLSL] getting the camera's position.

This topic is 2824 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
I think it should be the last column of the inverted view matrix.

The view matrix transforms from world space to camera space. What you're looking to do is to transform 0,0,0 in camera space into world space, so that explains the inversion.

Share this post


Link to post
Share on other sites
thnx!

OK this might sound like a realy stupid question but i cant seem to find it googling.

How do i access the data inside a mat4? for example how do i get the element at row 1 column 2?

Share this post


Link to post
Share on other sites
Quote:
Original post by karwosts
For "mat4 M"

M[2][1] is element at column 2 row 1.


eek!

who would have guessed :D

sorry i dont know what i was expecting... Thought it would have some kind of weird santyx.

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!