Skip to main content
GameDev.net gamedev.net
🔒 Locked

Why does this happen?

Started by SonShadowCat Jan 5, 2002 at 10:17 PM 10 replies 850+ views
Original Post
SonShadowCat
SonShadowCat
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
      

  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;

      
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
--------------------------------- "Those who serve no purpose, have no purpose."- SSC Oh the possibilities!!Edited By - SonShadowCat on Your Girlfriends Birthday
23yrold3yrold
23yrold3yrold
Wouldn''t this be better served posted in NeHe''s forum? What''s it doing here?

Chris Barry
Jesus saves ... the rest of you take 2d4 fire damage.
Drizzt DoUrden
Drizzt DoUrden
quote:
Original post by 23yrold3yrold
Wouldn''t this be better served posted in NeHe''s forum?



Yes.

quote:

What''s it doing here?



Awaiting flames.


------------------------------
Simple DirectMedia Layer:
Main Site - (www.libsdl.org)
Cone3D Tutorials- (cone3D.gamedev.net)
GameDev.net''s Tutorials - (Here)
------------------------------Put THAT in your smoke and pipe it
SonShadowCat
SonShadowCat
i posted like crazy in the OGL forum and no one hepled

i do not want to get flamed you lousy dark elf

23yrold: im gonna try that thx

"Those who serve no purpose, have no purpose. SSC the Super Saiyan Cat"
--------------------------------- "Those who serve no purpose, have no purpose."- SSC Oh the possibilities!!Edited By - SonShadowCat on Your Girlfriends Birthday
draqza
draqza
If no one helped over in the GL forum, then you just had bad luck. That doesn''t mean you should post it here.

*lights the flamethrower*
WNDCLASSEX Reality;......Reality.lpfnWndProc=ComputerGames;......RegisterClassEx(&Reality);Unable to register Reality...what's wrong?---------Dan Uptonhttp://0to1.orghttp://www20.brinkster.com/draqza
Drizzt DoUrden
Drizzt DoUrden
I don''t think your flame throwers going to hurt as bad as my flaming coconuts on a catapult...

Really though, post in NeHe or OpenGL, or even DirecX. You aren''t going to find the answers here SSC.

------------------------------
Simple DirectMedia Layer:

Main Site - (www.libsdl.org)
Cone3D Tutorials- (cone3D.gamedev.net)
GameDev.net''s Tutorials - (Here)

OpenGL:

Main Site - (www.opengl.org)
NeHe Tutorials - (nehe.gamedev.net)
Online Books - (Red Book) (Blue Book)
------------------------------Put THAT in your smoke and pipe it
SonShadowCat
SonShadowCat
oh the humanity

fine you numb nuts, screw you guys, im going to Nehe ><

"Those who serve no purpose, have no purpose. SSC the Super Saiyan Cat"
--------------------------------- "Those who serve no purpose, have no purpose."- SSC Oh the possibilities!!Edited By - SonShadowCat on Your Girlfriends Birthday
draqza
draqza
quote:
Original post by SonShadowCat
oh the humanity

fine you numb nuts , screw you guys, im going to Nehe ><

"Those who serve no purpose, have no purpose. SSC the Super Saiyan Cat"


Does anyone even say that anymore?

Well, normal people anyway.
WNDCLASSEX Reality;......Reality.lpfnWndProc=ComputerGames;......RegisterClassEx(&Reality);Unable to register Reality...what's wrong?---------Dan Uptonhttp://0to1.orghttp://www20.brinkster.com/draqza
Drizzt DoUrden
Drizzt DoUrden
No but don''t worry, 23yearold3yearold proved to ssc that posting in NeHe is correct. He now has the anser.

------------------------------
Simple DirectMedia Layer:

Main Site - (www.libsdl.org)
Cone3D Tutorials- (cone3D.gamedev.net)
GameDev.net''s Tutorials - (Here)

OpenGL:

Main Site - (www.opengl.org)
NeHe Tutorials - (nehe.gamedev.net)
Online Books - (Red Book) (Blue Book)
------------------------------Put THAT in your smoke and pipe it
23yrold3yrold
23yrold3yrold
Yeah, but from the look of that thread, he doesn''t get it yet But at least I now understand what the problem was. Bit vague above ....

Chris Barry (crbarry at mts.net)

My Personal Programming Depot
Jesus saves ... the rest of you take 2d4 fire damage.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.