[GLSL] getting the camera's position.

Started by
3 comments, last by Wilhelm van Huyssteen 13 years, 7 months ago
How can i get the camera's position in World Space if i have the view matrix in GLSL?
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.
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game
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?
For "mat4 M"

M[2][1] is element at column 2 row 1.
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game
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.

This topic is closed to new replies.

Advertisement