*.3DS object collision

Suppose I load a .3DS file or a .ASE file into mu OpenGL program. What would be a way to handle my collision routines in respect to this object.

I realize I cn do things like bounding sphere collision for smaller things, but I’m interested in more complicated objects

For instance, If I create a House consisting of one room in 3D Studio Max, (then load this house into my opengl program, position it, rotate it etc), how do I determine “where” it is (with all the individual triangles it consists of)

Does this make sense? If I build a simple room with 4 walls and a floor, I know what planes I’m using, and where the triangles on these planes lie. I run my collison on this and all is dandy.

But with loading objects, how do I find out where each polygon is to start with? My guess is that this is complicated. I want to be able to use my collision routines on general objects in the same way I would on object I create (where I know all the points/planes beforehand)

Am I making this more difficult then it has to be?


Well, being new to collinion dection but I have some experance with .3ds file loading, I as far as I know 3ds files do not have any boundray boxes defined in the the file like .md3 files, so the way that I would try to do this is each time I load an and obj from the 3ds file I would just store the cords and make a boundary box around it. Did that make any sence? The ed3 file is orginized in a tree and the seperat obj are on seperat terr nodes so it is easy to load each obj in the room seperatly and do what ever you need to do for you collision stuff.

Hope that helped if not at lesat somone will correct me and that may help you

good luck

Maybe I’m wrong, but it seems you have a “container space” (the house) and some “contained objects” (players ? ppl ? ).

I’m quite sure the best way to do it is to create a good BSP structure for the container(the house), and another tree structure to store the contained objects’ (players,ppl,puppies)bounding spheres/boxes/ellipsoids. (For examples, a single bounding sphere for the whole body, one smaller for the head, another for the chest, another for right harm…and so on)

Gets faster to check for collisions between the BSP nodes and the ppl’s trees in the house.

Hope this helps.

bye, rIO

You should always cut your geometry into small pieces (i.e. by using a BSP) Then you will try to collide with the primitives in there. (I guess you’re using triangles)
Then you can load as complex geometry as you want and you will be able to code collision detection routines, which are fast and stable.

If you have questions on how to do this, ask me at gl@martinwerner.de!