views:

182

answers:

1

Hey guys,

Say I use glRotate to translate the current view based on some arbitrary user input (i.e, if key left is pressed then rtri+=2.5f)

glRotatef(rtri,0.0f,1.0f,0.0f);

Then I draw the triangle in the rotated position:

glBegin(GL_TRIANGLES);  // Drawing Using Triangles
    glVertex3f( 0.0f, 1.0f, 0.0f);  // Top
    glVertex3f(-1.0f,-1.0f, 0.0f);  // Bottom Left
    glVertex3f( 1.0f,-1.0f, 0.0f);  // Bottom Right
glEnd();  // Finished Drawing The Triangle

How do I get the resulting translated vertexes for use in collision detection? Or will I have to manually apply the transform myself and thus doubling up the work?

The reason I ask is that I wouldn't mind implementing display lists.

+3  A: 

The objects you use for collision detection are usually not the objects you use for display. They are usually simpler and faster.
So yes, the way to do it is to maintain the transformation you're using manually but you wouldn't be doubling up the work because the objects are different.

shoosh