Render Collision Mesh

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Izzo
Posts: 2
Joined: Sun Sep 25, 2011 6:41 pm

Render Collision Mesh

Post by Izzo »

Hi!

I'm trying to implement a debug view, where I can see the collision meshes of all scene objects, espacially of those ones having a convex hull shaped collision mesh. I'm using the vertices of the collision infomation shape of the entity class, but it seems like that I cannot render them as a closed mesh, because I have no idea how they are arranged. Do they match a specific XNA primitve type or do I have to use indices to render them?

Thanks
Izzo
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Render Collision Mesh

Post by Norbo »

A convex hull is a point cloud, so there is no connectivity information. You'll need to triangulate it first in order to render it. The convex hull algorithm outputs surface triangles so re-running it on the data would do the trick.

Instead of creating your own debug drawer, it's easier to use the BEPUphysicsDrawer library in the BEPUphysicsDemos. You can get the source for it over in the main source download: http://bepuphysics.codeplex.com/SourceC ... changesets
Post Reply