Jump to content
  • Advertisement
Sign in to follow this  
cnjcombo

Animation with scaled and literal pixel objects

This topic is 4631 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have ran into a problem, I made some objects using scales and now my old method of animation is obsolete. For example I would just have 2 var's set for the left side of a rectangle, which was an arm, and to move the arm up and down I would just increase the value of the arms left side var's. Now since I scaled the objects to size I don't have the option of doing that, I am trying to use glRotate to rotate the arm 45 degrees but it has not worked to my liking.....
	
	glPushMatrix();
	glColor3f(1.0, 1.0, 0.5); 
	glScalef(40.0, 2.0, 0.0);		
	glRotatef( -45.0f, 0.0f, 0.0f,0.0f);	
	unitSquare();	
	glPopMatrix();

I put -45.0 to rotate the rect 45 degrees upward and nothing happens, just stays horizontal.

Share this post


Link to post
Share on other sites
Advertisement
replace glRotatef( -45.0f, 0.0f, 0.0f,0.0f);

with

glRotatef( -45.0f, 1.0f, 0.0f,0.0f);

or a 1.0f (or another value between 0.0 & 1.0 for fractions) for whatever axis you want to rotate it in:
glRotatef( angle, x, y, z);

Share this post


Link to post
Share on other sites
No dice, still isn't rotating at all....


glPushMatrix();
glColor3f(1.0, 1.0, 0.5);
glScalef(40.0, 2.0, 0.0);
glRotatef( -45.0, 0.999, 0.0,0.0);
unitSquare();
glPopMatrix();

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!