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

Rotating moving objects.

Started by Dakath Sep 15, 2000 at 10:47 AM 1 replies 300+ views
Original Post
Dakath
Dakath
Pretty much what the subject says ... You see, right now my movable cube seems to orbit around the starting position, which isn’t really what I want. , I have toyed around with the x,y,z values in the glrotatef function. Making them match the position of the cube and so on ... but I’m not getting it right.(It results in -really- strange stuff) If anyone could help me out with this id really appriciate it.
--------------------Moo, that’s right, moo!
Meduzza
Meduzza
Move object to (0,0,0)
Rotate it.
Move it back.
Strylinys
Strylinys
Also try pushing the matrix then loading identity THEN doing translations and pop the matrix back.

glPushMatrix();
glLoadIdentity();
glRotated(deg, x, y, z);
glTranslated(x, y, z);
DrawThings();
glPopMatrix();

That should work, in theory.
S.

Topic Locked

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

Sign in to reply to this topic.