PDA

View Full Version : control matrix stacks in multipass Render



th3w1zard
11-25-2009, 10:44 AM
hello,

iīm perfoming a multipass render into fbo, and i have 2 objects a cube and a sphere, the problem is that when i rotate the camera , the cube stays in itīs place but the sphere follows me , and the cube doesnīt , why is this happening ? the sphere should stay in itīs place, like th ecube does iīm using my own matrix stacks and there is no other transformation applied besides the lightīs translation, this is what iīm doing :



Bind Render

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glLoadMatrixf(projMATRIX);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glLoadMatrixf(modelView);

Cube();

glTranslatef(pos,pos,pos);
DrawSphere()

Unbind Render


any ideas?!

Thanks

th3w1zard
11-25-2009, 11:52 AM
upsssss...never mind i didnīt push and pop