Bounding Box - IN - X file parsing

Started by
13 comments, last by GENTS 19 years, 7 months ago
You can use the D3DXLoadMeshFromXof function and the ID3DXFile, ID3DXFileEnumerator and ID3DXFileData interfaces to get to teh mesh object.

Open the xfile, and iterate through the hierarchy until you find a TID_D3DRMMesh template, then load that using D3DXLoadMeshFromXof and compute the bounding box using D3DXComputeBoundingBox
[size=2]aliak.net
Advertisement
Ok I'll try it

Could you post some code to help me?!

THANKS!
----------------------------------------------- - GENTS -"Every man dies, not every man really lives"[William Wallace] - visit my website: GENTS.it -- Using Effect files with DirectX 9 Basics Tutorial -- MilkShape 3D models and OpenGL ES Tutorial -
no news..no code...no help...

sigh sob!
----------------------------------------------- - GENTS -"Every man dies, not every man really lives"[William Wallace] - visit my website: GENTS.it -- Using Effect files with DirectX 9 Basics Tutorial -- MilkShape 3D models and OpenGL ES Tutorial -
The DirectX SDK has a sample (meshes\skinnedmesh) Read the code on how the .x data are processed. It reads the .x file frames as you want to do. You do not need to process the skin and bone info as he does but you should easily modify it to get the mesh vertices for each frame and build a bb around each mesh.
ok!
I've found the way to compute all bounding boxes and to keep in an array all min and max values and in another array all different meshes...

But I've another problem now, but that's only caused by my level model...

I've a level that is a "circuit" for my cars game and that have the shape of a sort of "8"...

_ _ _
/ | | but all borders of the level are an unique mesh,
| | so if I create bb around it, I've a big one bb
\ / not useful for my scope...
-----
/ \ So, how cai I solve this new problem?!
| | Should I split my mesh in a lot of little meshes
| | or exist another way to implement collision
\_ _ _ / having an unique mesh that represent wall and
to create bb around pieces of this wall?!

THANKS FOR HELP!!!
----------------------------------------------- - GENTS -"Every man dies, not every man really lives"[William Wallace] - visit my website: GENTS.it -- Using Effect files with DirectX 9 Basics Tutorial -- MilkShape 3D models and OpenGL ES Tutorial -

This topic is closed to new replies.

Advertisement