views:

38

answers:

1

Hello,

I've written a C++ library that reads in this 3d model file (collada DAE). uptil now, I would output a list of triangles and handle each of them at rendering stage.

But now, I need to attach some Bounding sphere information with the imported model. I need some advice on how should I organize this in code. Here are some specs of the 3D file format: - 3D model is represented as a Tree consisting of nodes - each node can contain other nodes, geometry information, transformations etc

My requirements: - a bounding sphere associated with each node, thereby yielding a tree of bounding sphere hierarchy for the model itself. - actual vertex information

So, how should I ouput this ? Should I just output the triangles as it is and a tree of bounding spheres ? Or should I output the Geometry hierarchy as well ?

What would be the recommended way to deal with this situation?

Thanks

A: 

I apologize for the confusion. As of now, I have a separate library that reads a collada model and loads it into a structure(MyModel). Uptil now, I was using MyModel only for rendering purposes, but now I need to perform collision detection in a way, that helps me identify which part of the model has been hit. This is crucial for my game mechanic.

My question is: How should I modify MyModel to accomodate this collision information ?

Collada model: It is a Tree with nodes as I had mentioned in my question. Collision information: I was thinking of generating a tree of bounding-sphere (one BSphere for each node of Collada Model) and somehow integrate this Bounding Sphere tree in MyModel.

I needed some opinion, if what I am doing sounds sensible or if you have any other advise for me ?

Please let me know if any of this is not clear..

Thanks

brainydexter