jordi polo
unread,Jul 17, 2009, 10:59:30 PM7/17/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ode-users
I'm still trying to work with trimesh, this time I got an ODE error
ODE Message 3: LCP internal error, s <= 0 (s=-2.0030e-03)
ODE Message 3: LCP internal error, s <= 0 (s=-1.9887e-04)
ODE Message 3: LCP internal error, s <= 0 (s=-3.2976e-05)
ODE Message 3: LCP internal error, s <= 0 (s=-9.0132e-05)
ODE INTERNAL ERROR 1: assertion "bNormalizationResult" failed in
_dNormalize4() [../../include/ode/odemath.h]
ODE compiled with double precision
The data should be just a cube (simple trimesh test, will use
something more complex if I manage to make this work):
const int VertexCount = 8;
const int IndexCount = 36;
double Vertices[VertexCount * 3] = {
0.01, 0.01, -0.01,
0.01, -0.01, -0.01,
-0.01, -0.01, -0.01,
-0.01, 0.01, -0.01,
0.01, 0.01, 0.01,
0.01, -0.01, 0.01,
-0.01, -0.01, 0.01,
-0.01, 0.01, 0.01};
dTriIndex Indices[IndexCount / 3][3] = {
{0, 1, 2},
{2, 3, 0},
{4, 7, 6},
{6, 5, 4},
{0, 4, 5},
{5, 1, 0},
{1, 5, 6},
{6, 2, 1},
{2, 6, 7},
{7, 3, 2},
{4, 0, 3},
{3, 7, 4}};
Loaded like this:
dTriMeshDataID new_tmdata = dGeomTriMeshDataCreate();
dGeomTriMeshDataBuildSingle(new_tmdata, &Vertices[0], 3 * sizeof
(double), VertexCount,
(dTriIndex*)&Indices[0], IndexCount, 3 *
sizeof(dTriIndex));
kendama[SARA].geom = dCreateTriMesh(space, new_tmdata, 0, 0, 0);
// remember the mesh's dTriMeshDataID on its userdata for
convenience.
dGeomSetData(kendama[SARA].geom, new_tmdata);
And draw like this:
for (int i = 0; i< IndexCount / 3; i++)
{
const double v[9] = {
Vertices[Indices[i][0] *3 + 0],
Vertices[Indices[i][0] *3 + 1],
Vertices[Indices[i][0] *3 + 2],
Vertices[Indices[i][1] *3 + 0],
Vertices[Indices[i][1] *3 + 1],
Vertices[Indices[i][1] *3 + 2],
Vertices[Indices[i][2] *3 + 0],
Vertices[Indices[i][2] *3 + 1],
Vertices[Indices[i][2] *3 + 2]
};
dsDrawTriangleD(dGeomGetPosition(geom),
dGeomGetRotation(geom), &v[0], &v[3], &v[6], 1);