hey kipl20
any luck so far?
Main Topics
Browse All Topicshi, i would like to know how to animate an md2 model using opengl and C++.
i have loaded the md2 file in and can get it to display fine. but i dont know where to go from here?
i think i need to make keyframes out of the model but how do i do that?
i am a newbie and this is confusing to me, so go easy on me and try to explain it as easily as u can lol
thanks in advance
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
hi, no luck as of yet, i have code to load the models in etc, but i fall down at the stage of actually setting up the model to animate.
i have set up an array to access the md2 model, where would i go from here, how would i access the first keyframe and move to the second etc?
any ideas,
thanks in advance
hi yes i did have a look but i didn't really understand, i am completely new to this and find it extremely difficult and confusing.
i have included code below, i can get the Md2 to appear on rendering so there is no problem loading the model, i just dont know how to go about setting up the key frames etc
thanks
I've animated MD2 models so I am able to help.
The header of the MD2 has a variable containing the number of vertices used in the MD2, the number of frames and the file offset to the first frame.
A frame is structured like this -
typedef struct
{
float scale[3];
float translate[3];
char name[16];
}
MD2_FRAME;
That is followed by an array of vertex structures, like this -
typedef struct
{
unsigned char x, y, z, n;
}
MD2_VERT;
That's followed directly by the next frame. All the frames are the same size, so you can calculate the size of one frame and multiply that by the frame number to get a specific frame.
x, y, z are transformed by the scale and translate values for the frame. n is an index into an array of normals, which you should find at the link provided by ikework.
The triangles of the MD2 model are described like this -
typedef struct
{
short vert[3];
short uv[3];
}
MD2_TRI;
vert is an index into the vertex array. uv is an index into the texture coordinate array. There is only one texture coordinate per vertex as the UV's do not animate in an MD2.
Need anymore info?
hey man
following is the best place to learn about your problem.
http://www.videotutorialsr
Business Accounts
Answer for Membership
by: ikeworkPosted on 2009-03-16 at 02:34:38ID: 23895802
hey kipl20
d/models/m d2.htm
have a look at:
http://tfc.duke.free.fr/ol
especially the paragraph "Animating"
ike