glLoadIdentity();
glRotatef(-camera.pitch, 1, 0, 0);
glRotatef(-camera.heading, 0, 1, 0);
glTranslatef(-camera.position.x,
-camera.position.y,
-camera.position.z);
glPushMatrix();
glTranslatef(model1.position.x,
model1.position.y,
model1.position.z);
glRotatef(model1.heading, 0, 1, 0);
drawModel(&model1);
glPopMatrix();
glPushMatrix();
glTranslatef(model2.position.x,
model2.position.y,
model2.position.z);
glRotatef(model2.heading, 0, 1, 0);
drawModel(&model2);
glPopMatrix();
Collision detection
Transform the polygons yourself. You'll need some basic vector*matrix and maybe matrix*matrix functions.
If you don't want to construct the individual transformations directly (can be better because you have more control, but is more work), you can use glGetFloat() to extract the transform matrices you are using.
[edited by - JuNC on April 13, 2003 9:12:26 AM]
If you don't want to construct the individual transformations directly (can be better because you have more control, but is more work), you can use glGetFloat() to extract the transform matrices you are using.
[edited by - JuNC on April 13, 2003 9:12:26 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement