MD3 Model BB calculation

Started by
0 comments, last by Ilici 19 years, 4 months ago
hello! I want some help. How can I get the bounding box of an MD3 model? I the BB to be calculated for each model and not define it by hand. But the md3 models has not actual vertex coordinates. but they have some matrices that transform the md3 parts of a model (upper, head, torso). How can I calculate the BB for the whole model? thanks in advance!
Advertisement
Do the same transformations as if you were rendering and use the transformed vertices to calculate the bb.

A bb can be defined as 2 vectors: bottom_left_back and top_right_front. Compare the current vertex's components with these vectors and adjust the bb vectors accordingly.

You should probably do it in your rendering loop so you don't loop and transform twice. This bb that you compute can be used for the next frame for collision and stuff (even if the next frame will have a slightly different transformation the difference between two frames should be very small so you can use the previous bb for the current frame).

This topic is closed to new replies.

Advertisement