#### Archived

This topic is now archived and is closed to further replies.

# Questions concerning Quake engine model files!

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

## Recommended Posts

Hi to all: 1. Can anyone pliz tell me how to calculate the bounding sphere of a MD2 model object if I have already had all its geometric infomation(like vertex, vertex index, texture coordinates.....) stored in a structure ready. 2. Is there a certain advantage of using MD3 files over using MD2 ones? Does a MD3 file have more detail, or more speed advantage? Thanks for answering these two quesions for me in advance.

##### Share on other sites
I'll give you a hint about the bounding sphere and then you can figure it out for yourself.

You need to decide if you want the (1) average sphere or the (2) smallest sphere that all of the geometry will fit in.

(1) You're going to need to loop through all the vertices obviously and obtain their average. Then you need to think about what it is that the average you found means and what you could do with it. Hint: The average is a point and the MD2 model's origin (I'm pretty sure) is (0,0,0).

(2) Just loop throught the vertices and find the biggest. This is also a point, again use it with the origin.

I'm not sure about the differences between MD2 and MD3 models.

[edited by - MagicScript on September 12, 2002 12:10:19 PM]

##### Share on other sites
If you''ve already loaded the vertex data into a buffer, you can use the D3DXComputerBoundingSphere function to do it for you. If the vertices are in a vertx buffer, first lock the buffer and pass the pointer to the function. In return, you''ll get the radius of the sphere that encloses all vertices.

home.att.net/~rpgbook
Author, Programming Role-Playing Games with DirectX
and Focus On: Advanced Animation with DirectX

##### Share on other sites
Thanks very much for the answers. They do help out a lot.

Can anyone shed some light on the differences between MD2 and MD3 files to this time pliz?!

##### Share on other sites
quote:
Original post by ji yan
Thanks very much for the answers. They do help out a lot.

Can anyone shed some light on the differences between MD2 and MD3 files to this time pliz?!

MD2 is a model with a 256x256 skin for the whole body and a 128x128 skin for the head. The whole model is a solid, there are multiple positions stored, and for animation it interpolates the in between positions. So eg. one model standing, one with legs spread in a walking position, and it interpolates in between. This is not very flexible.

MD3 uses a bone structure, one model is stored, for each vertex a relation to the bones. Bones are just transformation matrices. This is a modern technique and would be preferred.

##### Share on other sites
quote:
Original post by Fidelio_
MD3 uses a bone structure, one model is stored, for each vertex a relation to the bones. Bones are just transformation matrices. This is a modern technique and would be preferred.

Wow, Fidelio posted the same time as I did ^_^. I am not
sure about MD3 having the same kind of bone animation
as say a skinned X-file model would. I tried messing out
with it once before and could not find any actual bones
(like that of a Half-Life model). The MD3 mode I played with only
had a tag for the head, body and legs. I don''t see how we
can do bone animation on it and the bone files seems a bit

_________________
Best regards,
Sherman Chin
www.Sherman3D.com

##### Share on other sites
quote:

MD2 is a model with a 256x256 skin for the whole body and a 128x128 skin for the head. The whole model is a solid, there are multiple positions stored, and for animation it interpolates the in between positions. So eg. one model standing, one with legs spread in a walking position, and it interpolates in between. This is not very flexible.

As far as I can tell, most .MD2 models use only one texture, not two. The second smaller texture is an icon image used for selection/display of the character mesh being used.

With .MD3, you are splitting the model up into three components - top, middle, and bottom. Each component is basically their own .MD2 type of file, where each is a set of morphing animations.
The three components are connected via links, which are something akin to bones. The transformations from each bone affect the way each of the three components are joined and rendered.
Animations are handled separately for each components - the top can use a different animation than the middle and bottom. Same goes for the other two components. In this way, you can mix animations to create new ones. For instance, the legs can be running while the middle is picking something up, or the top can be nodding while the bottom is ducking.

That''s the basics of .MD3 at least.

home.att.net/~rpgbook
Author, Programming Role-Playing Games with DirectX
and Focus On: Advanced Animation with DirectX

##### Share on other sites
There''s more than one type of MD2 file, which is causing the confusion.

Quake 3 Arena used MD3 files that used vertex animation and were split into 3 (or more) submodels.

Quake 3 Team Arena introduced skeletal animation, and the models were no longer necessarily split into segmented submodels.

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633703
• Total Posts
3013453
×