Advertisement

Why does this happen?

Started by January 06, 2002 10:51 AM
26 comments, last by SonShadowCat 23 years, 1 month ago
for(int z=0; z
im kinda guessing this is a mistake and and x should be a z

"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
Instead of transforming, and then "back transforming" to get to the original point, save the matrix with glPushMatrix, do the transformation, and then restore the matrix with glPopMatrix.

  void DrawMine(int x, int y, int z, int xrot, int yrot, int zrot){{   glPushMatrix();   glTranslatef(x, y, z);   glRotatef(xrot, 1.0f, 0.0f, 0.0f);   glRotatef(yrot, 0.0f, 1.0f, 0.0f);   glRotatef(zrot, 0.0f, 0.0f, 1.0f);   triangle.DrawTriangle();   glPopMatrix();}  
Advertisement
ohh i didnt know you could do that

*changing code* ty

"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
lol i took out the rotations and used glPopMatrix and glPushMatrix and the program froze lol

"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
well what do you know, with all your help i was able to fix it

i love you guys!

i really owe you, it turned out as a mine field but i took out the rotation
im gonna add the rotation after this post

thx again guys, without your help i would never have done this


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
one more thing for future reference

you guys didnt tell me that when you want to "un-rotate" something you have to do it in opposite to the order you rotated

i.e.

  glRotatef(xrot, 1.0f, 0.0f, 0.0f);glRotatef(yrot, 0.0f, 1.0f, 0.0f);......glRotatef(-yrot, 0.0f, 1.0f, 0.0f);glRotatef(-xrot, 1.0f, 0.0f, 0.0f);the tornado effect still took place until i realized I had to do this  


"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
Advertisement
In my example I did put it that way.

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"
yea but i didnt realize i had to do it that way ALL the time

no matter, it works now and im happy

"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

This topic is closed to new replies.

Advertisement