Ok, so I've researched faces a little more, and now I'm of the opinion that it
means a list of triplets, each triplet holds the index of 3 vertices in the
vertice list.
Unfortunately now that I've got my trimeshdata building I get a seg fault as
soon as I test for collisions.
here's a snippet of my code to create the geometry
odePos = (2.0, 2.0, 0)
triMeshData = ode.TriMeshData()
verts = [(0.0, 0.0, 0.0),#0
(2.0, 0.5, 0.0),#1
(2.0, 0.5, 1.0)]#2
faces = [(0,1,2)]
triMeshData.build(verts, faces)
geom = ode.GeomTriMesh(triMeshData, space)
geom.setPosition(odePos)
Which I'm expecting to create a geom with a single triangle on an incline.
I've tried using the same thing to define a complete wedge (my eventual goal)
using shared vertices. I guess the only thing left that I haven't tried is a
wedge with repeated vertices, assuming there could be a problem if the tri-mesh
is not a closed shape...
I think this is an area where the docs could definitely use a little extra
commentary. It may be that I'm just lacking a lot of basic 3d programming
fundamentals, but I think there's probably more than one way of specifying
vertexes and faces and neither the tutorials nor the docstrings really talk
about how you go about setting the trimesh data up.
Once I understand it I'd be happy to provide some extra doc strings and/or a
tutorial
|