Advertisement

Newbie: Flipping

Started by January 15, 2001 11:44 AM
0 comments, last by plastickid 23 years, 10 months ago
Can someone tell me how I can flip a triangle completly because I want to make a diamond and I can''t seem to do it..I want the opposite of this: //2d triangle glLoadIdentity(); glTranslatef(-2.5f,4.0f,-15.0f); glRotatef(rtri2,0.0f,1.0f,0.0f); glBegin(GL_TRIANGLES); glVertex3f(0.0f, 1.0f, 0.0f); glVertex3f(-1.0f,-1.0f, 0.0f); glVertex3f(1.0f,-1.0f, 0.0f); glEnd(); rtri2+=1; This is a regular triangle like this:/\ i want one of this \/ the other way thanks a million.. plastickid Too lazy to think!
Too lazy to think!
It''s easy. You only need to change the sign of the Y values of the glVertex commands like this:

glVertex3f( 0.0f,-1.0f, 0.0f);
glVertex3f(-1.0f, 1.0f, 0.0f);
glVertex3f( 1.0f, 1.0f, 0.0f);

Hope that helps. (Hmm, pretty cliche, eh? )
Dirk =[Scarab]= Gerrits

This topic is closed to new replies.

Advertisement