Animation with scaled and literal pixel objects

Started by
1 comment, last by cnjcombo 18 years, 5 months ago
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.
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);
"I must not fear. Fear is the mindkiller. Fear is the little death that brings total obliteration. I will face my fear. I will permit it to pass over me and through me. And when it has gone past me I will turn to see fear's path. Where the fear has gone there will be nothing. Only I will remain." ~Frank Herbert, DuneMy slice of the web
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();

This topic is closed to new replies.

Advertisement