kreyszig

09-10-2008, 06:21 AM

Hi,

I'm trying to manipulate the camera position from within a vertex shader. (The question is about the math, not using the shader)

Background: I want to render from a light position to calculate an opacity shadow map. I don't have full control over the rendering pipeline and have to perform this transformation in a vertex shader.

I can be confident that there are no modelling transformations applied to my geometry - I only ever move the camera. But the camera position can obviously be a combination of rotations and translations.

Is there a way I can generate my own modelview matrix if I know the camera target and position?

EDIT... googles Glulookat, finds answer

I'm trying to manipulate the camera position from within a vertex shader. (The question is about the math, not using the shader)

Background: I want to render from a light position to calculate an opacity shadow map. I don't have full control over the rendering pipeline and have to perform this transformation in a vertex shader.

I can be confident that there are no modelling transformations applied to my geometry - I only ever move the camera. But the camera position can obviously be a combination of rotations and translations.

Is there a way I can generate my own modelview matrix if I know the camera target and position?

EDIT... googles Glulookat, finds answer