hi all,
i am working on a project based on a graphic library named OpenSG.
I want to add a couple of vertex/fragment programs, but i can’t get the position of the camera (it is stored into a private variable).
Is there a state variable holding that data?
something like the ole good
No, because there is no OpenGL state that holds the camera position. However, you know that in eye space, the camera is always at the origin, so if you really need it, you could multiply the vector [0, 0, 0] with the inverse of the modelview matrix.
That looks good to me. Make sure that you have only view transformations on the modelview stack, as I assume you don’t want model transformations to affect the view position.