Jump to content

  • Log In with Google      Sign In   
  • Create Account


rotation in 3d..


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Drizzt DoUrden   Members   -  Reputation: 100

Like
Likes
Like

Posted 19 August 2001 - 06:59 PM

What exactly would I write to slow down the roation of a 3d object, the object I am using is a basic figure made of blocks(just to test out some stuff), and I just was wondering if I could make the rotation slower. If this is an extremely complicated thing, please, just reply telling me it is complicating, because I am just getting around texture mapping now, so I am just between newbie/intermediate, and prob. closer to newbie. Its not really something I need, I am just curios of openGLs capabilites "I''''ve sparred with creatures from the nine hells themselves... I barely plan on breaking a sweat here, today."~Drizzt Do''''Urden

Sponsor:

#2 mkaltner   Members   -  Reputation: 122

Like
Likes
Like

Posted 19 August 2001 - 07:34 PM

Floats are your friend!

here''s a slow rotation example.

Render() {
...
glTranslatef(0.0f, 0.0f, 0.0f); // whever you need

glPushMatrix(); // save current matrix, work with new one
glRotatef(objectXRot, 1.0f, 0.0f, 0.0f); // rotate x
glRotatef(objectYRot, 0.0f, 1.0f, 0.0f); // rotate y
glRotatef(objectXRot, 0.0f, 0.0f, 1.0f); // rotate z

DrawObjectHere(); // draw object (cube, sphere...)
glPopMatrix(); // i''m done with this matrix! get the old one back

objectXRot += 0.01f; // set new global x,y,z
objectYRot += 0.01f;
objectZRot += 0.01f;
...
}

This would draw whatever your doing with a very slow rotation. Hence the x, y and z increment of only 0.01.

Good luck!
And if there''s a problem with what I said, forgive me. I''m a newbie too! =)

- Mike

#3 Drizzt DoUrden   Members   -  Reputation: 100

Like
Likes
Like

Posted 20 August 2001 - 02:29 AM

I think I understand now. I think though, what I really need to do is make the camera rotate around an object, I figured if I make the object rotate slowly I could probably make a decent newbie matrix effect, lol. The problem is though, I remember reading in my book, something abot once the camera position is declared for the model, it cant change? I dont know maybe its the OpenGL Dreams I have been having, lol, j/k. There has to be a way to do it.

"I''''ve sparred with creatures from the nine hells themselves... I barely plan on breaking a sweat here, today."~Drizzt Do''''Urden

#4 mkaltner   Members   -  Reputation: 122

Like
Likes
Like

Posted 20 August 2001 - 05:35 AM

Not true, an OpenGL camera can be rotated in exactly the same way as an OpenGL object. Just change the position of it and set it. It''ll rotate! =)

- Mike

#5 Drizzt DoUrden   Members   -  Reputation: 100

Like
Likes
Like

Posted 20 August 2001 - 06:14 AM

lol.. Thank you very much. I will try it soon, what it is, is I made a boxy robot to practice on, and I wanted to see if I could make him kick, and it was, pretty easy, but then I said to myself " Make him kick, stop, and rotate to make a matrix efect" I did it, it didnt look like the matrix, so I put the rotation in slow mo, and it just tooks longer to not look like the matrix, lol. So, later on today I will try rotating the camera. Thank you!

"I''''ve sparred with creatures from the nine hells themselves... I barely plan on breaking a sweat here, today."~Drizzt Do''''Urden

#6 mkaltner   Members   -  Reputation: 122

Like
Likes
Like

Posted 20 August 2001 - 06:41 AM

No problem!
Sounds pretty cool too.
Being a newbie OpenGL''er like yourself I''d like to check it out when you''re done! =)

Send it to me in email if you wish.

- Mike

The important thing to remember when programming is: When you''re 90% complete, there''s still 50% more to go.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS