Animation

How animated complex figure, which consist of 6 figure&

are you asking how to animate something simlar to a human, or somewthing with 6 degrees of freedom or…?

SsssHhhh,
he’s still thinkin…

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

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

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…

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&