Importing meshs using *.obj

iZiMO
Posts: 7
Joined: Thu Jul 31, 2008 11:31 pm

Importing meshs using *.obj

Post by iZiMO »

Hi guys,

What i would like to do is read meshes in from .obj files and have these in my world as static meshes, specifically terrain. Forgive my ignorance, but i've looked over the convex decomposition and concave demos but i'm still not entirely sure what's going on.

I'm guessing i read the .obj file in using the wavefront object.. but then what is the process of creating a btBvhTriangleMeshShape with this data? Could anyone give me a run-through of the steps involved?

Cheers
User avatar
projectileman
Posts: 109
Joined: Thu Dec 14, 2006 4:27 pm
Location: Colombia

Re: Importing meshs using *.obj

Post by projectileman »

At first you need to fill a vertex array and a triface index array from a *.obj file.
Then you must provide a btTriangleIndexVertexArray from your array data for creating a trimesh collision object. The trimesh collision object could be a btGImpactMeshShape.
iZiMO
Posts: 7
Joined: Thu Jul 31, 2008 11:31 pm

Re: Importing meshs using *.obj

Post by iZiMO »

Excellent, thanks for the reply.