void main()
{
mat4 view = gl_ModelViewMatrix;
view[0][0] = 1;
view[0][1] = 0;
view[0][2] = 0;
view[1][0] = 0;
view[1][1] = 1;
view[1][2] = 0;
view[2][0] = 0;
view[2][1] = 0;
view[2][2] = 1;
vec4 P = view * gl_Vertex;
gl_Position = gl_ProjectionMatrix * P;
}
Make arbitrary geo face the camera
I'm trying to do a billboard vertex shader. All the examples I've seen here assume you're just drawing a quad, whereas my geometry is significantly more complex.
What I've tried so far is to just reset the upper 3x3 part of the model view matrix to the identity to try and remove the rotations, but without success (my object completely disappears from view!)
Has anyone succesfully done anything like this before?
Check This thread
[edit]Opps that might not be exactly what your looking for. I didn't read through it completely when I found it[/edit]
[edit]Opps that might not be exactly what your looking for. I didn't read through it completely when I found it[/edit]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement