PDA

View Full Version : what are teh minimal steps for inserting objects independently of each other into the



CelticDaddio
05-10-2006, 09:33 PM
Once I have my projection matrix setup, and I start my render loop, what are teh minimal steps for inserting objects independently of each other into the scene? Do I need to reset the model-view matrix each time by calling glLoadIdentity()?

Is this correct?


glLoadIdentity();
glTranslatef(x, y, z);
glRotatef(pitch, 1.0, 0.0, 0.0);
glRotatef(yaw, 1.0, 0.0, 0.0);
glRotatef(roll, 0.0, 0.0, 1.0);
glBegin();
.
.
.
glEnd();thanks,
CD

zed
05-10-2006, 10:31 PM
if i understand right

theres many methods for what u want, one easy method

glMatrixMode( GL_MODELVIEW );
gluLookAt(......)

+ for each object
glPushMatrix();
glMultMatrix( objs_orientation );
draw model { eg glBegin()..glEnd() }
glPopMatrix();