assertion "bNormalizationResult" with trimesh data

49 views
Skip to first unread message

jordi polo

unread,
Jul 17, 2009, 10:59:30 PM7/17/09
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);


jordi polo

unread,
Jul 17, 2009, 11:11:28 PM7/17/09
to ode-users
Ok, my bad, using
dGeomTriMeshDataBuildDouble

seems to solve the problem.

jordi polo

unread,
Jul 17, 2009, 11:21:59 PM7/17/09
to ode-users
In fact what is solved by using dGeomTriMeshDataBuildDouble is the
ODE error, now I am in the same status than before, even with this
simple model
and even when the AABB box draws in the correct place and size, the
trimesh is not draw (I debugged it and the relevant code is called).



On Jul 18, 11:59 am, jordi polo <mumi...@gmail.com> wrote:

Daniel K. O.

unread,
Jul 18, 2009, 1:33:51 AM7/18/09
to ode-...@googlegroups.com
jordi polo escreveu:

> In fact what is solved by using dGeomTriMeshDataBuildDouble is the
> ODE error, now I am in the same status than before, even with this
> simple model
> and even when the AABB box draws in the correct place and size, the
> trimesh is not draw (I debugged it and the relevant code is called).

I added your data to the moving trimesh demo, and it works fine.

Here's the diff:
http://pastebin.com/m2d7c636c

--
Daniel K. O.
"The only way to succeed is to build success yourself"

Reply all
Reply to author
Forward
0 new messages