pyode-user

 [Pyode-user] trimesh basics From: Travis Dixon - 2008-06-16 22:00:14 Attachments: Message as HTML ```Hi Everyone, I'm not only new to pyode, but relatively new to phyiscs sim's in general. I'm trying to create a 2d simulation of a bunch of balls bouncing off boxes and ramps. So far I can get the balls and the boxes working using sphere's and boxes, however I've gotten stuck on the ramps. As far as I can see trimesh is the geom I need to use, however I don't really understand how I'm supposed to structure my data. The constructor requires a list of vertexes and a list of faces, I'm guessing the vertexes are just 3d points, which i can handle (I just leave the third value at 0) but the faces I don't really understand. are they normals? do I need one for every pair of vertexes or every three vertexes? Is it going to extend from the center of the triangle to the specified point? Are there any online tutorials / docs explaining this data structure and how I can go about setting it up manually? Alternatively, are there any utilities floating around for creating tri-meshes in a GUI app and exporting the data to the pair of lists which I can then feed into pyode? Thanks for taking the time to read, Trav ```
 Re: [Pyode-user] trimesh basics From: Travis Dixon - 2008-06-17 22:59:57 ```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 ```
 Re: [Pyode-user] trimesh basics From: Travis Dixon - 2008-06-18 04:21:35 ```Sorry to be a bit spammy, but I've re-tested this on a winXP environment and the exact same code executes as expected without major problems. That leads me to believe that there's some problem with running the python-pyode package (available via apt-get) on Hardy Heron 64 bit. Regards, Travis Dixon ```