[ODE] re: trimesh woes
Mike Reinstein
web_fella at hotmail.com
Sat Aug 21 12:07:53 MST 2004
Ian:
I think the problem is that you arent passing in vaertices for
triangles....the data appears to be ordered for line loops, not triangles,
so you'll have to do some manipulation of the vertices array to get the
ordered properly. GL_LINE_LOOP draws a series of connected lines, where
GL_TRIANGLES expects every3 vertices to form a triangle. I would suggest you
look at your polygons rendered as GL_LINE_LOOP piece by piece...look at the
first 3 vertices, and make sure its being drawn as 1 triangle. If it is,
look at the first 6 vertices and make sure its being drawn as 2 triangles
correctly. then look at the first 9 vertices and make sure they are drawn as
3 triangles, etc.
I think you'll find that doing this will yield answers.
Hope this helps,
Mike
>From: Ian McMeans <imcmeans at telus.net>
>To: ode at q12.org
>Subject: [ODE] re: trimesh woes
>Date: Sat, 21 Aug 2004 03:12:32 -0700
>
>I've got a new problem, unfortunately. It seems like my trimeshes
>(no matter what the mesh data is, even a simple tetrahedron) hover a
>short distance above the box they should be resting on. And the
>distance they hover depends on the size of the trimesh, and the
>orientation (what I mean by that is that the "jet" (the
fish-shaped-
>thing) can balance on its nose, but when I try to have it rest on
>it's side, it rests a distance above the box.
>
>http://img23.exs.cx/my.php?loc=img23&image=problem.jpg
>
>So I thought maybe the trimesh data was bad, but when I draw the
>collision data like this:
>glBegin(GL_LINE_LOOP);
> for (int i = 0; i < totalTriIndices; i++)
> {
> glVertex3fv(vertices[triIndices[i]]);
> }
> glEnd();
>
>it looks the way I expect it to. The data is passed to ODE like
>this:
>dGeomTriMeshDataBuildSimple(odeMesh, (dReal*) vertices, totalVerts,
>triIndices, totalTriIndices);
>
>Anyone have any ideas what's going on? This doesn't happen with box
>geoms, but it happens when I hard-code the trimesh data for a cube.
>I don't understand what could be going wrong.
>
>Ian
>_______________________________________________
>ODE mailing list
>ODE at q12.org
>http://q12.org/mailman/listinfo/ode
_________________________________________________________________
Check out Election 2004 for up-to-date election news, plus voter tools and
more! http://special.msn.com/msn/election2004.armx
More information about the ODE
mailing list