Quote:Original post by Lord_Evil
stuff
Thanks for the reply
I actually got it to work in a different way.
Here is the code snippet:
void RenderCameraAlignedQuads(void){ float modelview_matrix[16]; float *inverse_modelview = (float*) malloc(4*4*sizeof(float)); glPushMatrix(); glGetFloatv(GL_MODELVIEW_MATRIX, modelview_matrix); m4_inverse(inverse_modelview, modelview_matrix); glMultMatrixf(inverse_modelview); for(int i = 0; i < no_quads; i++) { glPushMatrix(); glTranslatef(0.0,0.0,-i*10.0); glBegin(GL_QUADS); glColor3f(0.5,0.5,0.4); glVertex3f(-1.0,-1.0,0.0); glColor3f(0.5,0.5,0.4); glVertex3f(1.0,-1.0,0.0); glColor3f(0.5,0.5,0.4); glVertex3f(1.0,1.0,0.0); glColor3f(0.5,0.5,0.4); glVertex3f(-1.0,1.0,0.0); glEnd(); glPopMatrix(); } glPopMatrix(); free(inverse_modelview);}
Now what i need is to scale each quad so that when transformed to clip-space, it fills up the screen and i am done :)