[ODE] Trimesh collision (Terrain)

matt stephure stephure at gmail.com
Tue Aug 23 14:12:38 MST 2005


Sorry for the spam...

I've recoded my terrain generation loop to be about 5 lines. Much
simpler. I've gone through the vertices and indices with pencil and
paper and they all look right.

The problem I'm having now, is that the vertices seem to get all
messed up when I pass it into ODE.

Just before the dGeomTriMeshBuildSimple they're just fine. The
original data used to create the array remains fine, I'm printing it
out at every time step. But the vertex data I'm getting from
dGeomTriMeshGetTriangle is mostly wrong. Each value (x,y,z) is either
0, or 1265.15 -- instead of something in the rate {-2,2}. Seems to be
that I'm having a pointer error. Could anything else be wrong?

The format of the vertex data is
for (build_vertices)
{
    GLfloat * pos;
     pos = new GLfloat[3];
     pos[0] = value_x;
     pos[1] = value_y;
     pos[2] = value_z;

     terrainVertices[vertex_count] = pos;
     vertex_count++;
}

Appreciate the help! :) Sorry again for the spam.



More information about the ODE mailing list