Original Post
sry about posting this here but I get no replies anywhere else
What I need to know is why this code causes the triangles to act like a tornado(kinda) and not move together in a straight line
here is the code
I beg of you, plz help me
thx
P.S. To see the effect that is does so you can better understand and explain, you can d/l the thing at www.geocities.com/sonshadowcat2000/tornado.zip
"Those who serve no purpose, have no purpose. SSC the Super Saiyan Cat"
Edited by - SonShadowCat on January 5, 2002 11:32:52 PM
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer
glLoadIdentity(); // Reset The Current Modelview Matrix
glTranslatef( xpos, ypos, zpos); // Move 1.5 left and 8.0 out
glBindTexture(GL_TEXTURE_2D, texture[0]); // Select a texture to use
for (GLfloat x=1.0f; x<=2.0f; x+=1.0f)
{
for (GLfloat y=1.0f; y<=2.0f; y+=1.0f)
{
for (GLfloat z=1.0f; z<=2.0f; z+=1.0f)
{
glTranslatef( (x+2.0f), (y+2.0f), (z+2.0f)); // Move the screen
glRotatef( xrot, -1.0f, 0.0f, 0.0f);
glRotatef( yrot, 0.0f, -1.0f, 0.0f);
glBegin(GL_TRIANGLES);
triangle.DrawTriangle(); // Draw a triangle
glEnd();
}
}
}
xrot+=0.4f;
yrot+=0.4f;
|