PDA

View Full Version : Animation

DallasA
09-09-2002, 04:59 AM
How animated complex figure, which consist of 6 figure&

Gavin
09-09-2002, 05:49 AM
are you asking how to animate something simlar to a human, or somewthing with 6 degrees of freedom or.....?

Fragzem
09-09-2002, 04:53 PM
SsssHhhh,
he's still thinkin..........

DallasA
09-09-2002, 06:55 PM
Originally posted by DallasA:
How animated complex figure, which consist of 6 figure&

How rotate figure which consist of 1 sphere and 4 cone?

Gavin
09-10-2002, 12:02 AM
Rotate or animate?

/** rotate **/
glPushMatrix();
glRotatef(1.0, x, y, z);
drawMyFigure(size);
glPopMatrix();

/** animate **/
This could take a while...... If you are wanting to animate each of the elements, say to make it walk... seperate each one using thej Push/PopMatrix commands and animate as you want, you can use interpolation to work out the movement between 2 points and other such ideas.... depends what you are doing really...

nexusone
09-10-2002, 04:41 AM
First you need to draw up the movement you wish the object to do.
This is a good time to get a piece of paper and draw by hand the diffrent step's the object will move.

Let's say position one for our object's is:
object_1 = 3,4,5,15; x,y,z, angle
object_2 = 2,4,6,25; x,y,z, angle

in code look like this:

GLfloat object_1[1][4] = {{3, 4, 5, 15}, 9,12,15, 30}};// This is example of two movements
GLfloat object_2[1][4] = {{2,4,6,25}, {8,16,24, 50}};

display()
{

// Omitted code

glPushMatrix();

glPushMatrix(); // Draw object 1
glTranslatef(object_1[Frame][0],object_1[Frame][1],object_1[Frame][2]);
glRotatef(object_1[Frame][3], 1,1,1);
draw_object();
glPopMatrix();

//repeat code for object 2.

glPopMatix();

Hope this helps

Originally posted by DallasA:
How animated complex figure, which consist of 6 figure&