Skip to main content
GameDev.net gamedev.net
🔒 Locked

Mesh COLLISIONS

Started by GENTS Jul 2, 2004 at 2:58 PM 4 replies 600+ views
Original Post
GENTS
GENTS
How to create different collisions objects from a single mesh!? I can find faces index, vertex coords, etc, but I can't understand how "divide" a single mesh into different parts and so treat them with bounding boxes, BSP or other types of collisions detection... I'm going mad on collision methods and BSP, and I can't understand this LITTLE particular... THANKS A LOT FOR HELP!!! Byez, ----------------------------------------------- - GENTS - "Every man dies, not every man really lives" [William Wallace]
paranoia33
paranoia33
I wonder if progressive meshes could be used here to make low polygon copies of meshes and do ray -> triangle on them....and avoid bounding boxes/spheres all together.

The only place I would use those would be ... for example a bullet colliding with a player using the bones to create the boxes...anything else ... like you said a chair could be tested using a low polygon version of the chair.

I dont know....im just throwing out idea

Im new to collision as well



/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/Current Projects:PEngine - Full 3d FPS engine
tmkg21
tmkg21
go here: http://www.mvps.org/directx/articles/mesh_subset.htm
paranoia33
paranoia33
Unless i misunderstood the article..its just making subsets with just 50 faces....once it reaches 50 it starts a new subset..

but in context lets say you have a level with a floor, desk and a chair..and you want to make bounding boxes for each object based on their position/orientation of verticies...for example if the chair has a hole in it you still dont want something to collide with the empty hole...you would want a bounding box for the seat, the legs, the back and so on...im guesing the only way to do that would be to assign the subets your self based on the verticies..there is no smart function that will do this for you?

I think the best way (although tedious) would be to create 2 level meshes...1 with a low polygon version of what you want to get collided with and 1 high polygon one that will be rendered. Then you do ray->triangle interesection (D3DXIntersectTri()) on the collision triangles. Or use progressive meshes to make a low polygon collision mesh for you.
/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/Current Projects:PEngine - Full 3d FPS engine
GENTS
GENTS
I've tried with D3DXIntersect() and with a CD Library (http://users.volja.net/fajrvehr/) but I can't find the right way to detect collisions!

I'm also a problem with my code...
After I load my mesh and move and rotate in the 3D space, I lock Vertex and Index buffers to find vertex positions, face normals, etc...
but I've always .X file vertex positions and not moved or rotated...

How can I find this new positions?! Where it's possible that I'm wrong?!

and also:

How can I divide my Level-mesh in different parts so that I can compute different bounding boxes or spheres for walls, chairs, doors, windows, etc ?!?!

I hope that you that are a DirectX MASTER could help me to find a collision detection soluton....

THANKS A LOT!!!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.