arturapps arturapps at gmail.com
Sun Dec 17 05:51:24 MST 2006

```I´ve just discovered that my problems are the rotations I apply to my geoms.
I have no problem with translations but just with rotations .
I ´m doing rotations by computing the rotation matrix from Euller angles and
than using dGeomSetRotation .
I also noticed that dGeomSetRotation by matrix is very slow for complex
geoms.

That is the function I use to compute the matrix :

bool CollisionSystem::ComputeRotMatrix(double rotX, double rotY, double
rotZ, dMatrix3 & matrx)
{

/* Euller */

dReal alfa;
dReal beta;
dReal gama;

alfa = rotY;

beta = rotZ;

gama = rotX;

matrx[0] = cos(beta)*cos(gama);

matrx[1] = sin(alfa)*sin(beta)*cos(gama) + cos(alfa)*sin(gama);

matrx[2] = - cos(alfa)*sin(beta)*cos(gama) + sin(alfa)*sin(gama) ;

matrx[3] = - cos(beta)*sin(gama);

matrx[4] = - sin(alfa)*sin(beta)*sin(gama) + cos(alfa)*cos(gama);

matrx[5] = cos(alfa)*sin(beta)*sin(gama) + sin(alfa)*cos(gama);

matrx[6] = sin(beta);

matrx[7] = -sin(alfa)*cos(beta);

matrx[8] = cos(alfa)*cos(beta);

return true;
}

Lode Vanacken wrote:
>
> I just recently replaced our collision engine with ODE as a first step to
> move towards physics integration. I am also using GIMPACT and I don't
> have any problems at all.
>
> For drawing, what are you drawing? Are you using the ODE geoms or you
> own structure? I would
> suggest to draw both, this way you can see if they are aligned or not. I
> had problems with my vertex stride
> and so on, I know you have tested it in an example, but to make sure and
> as you are rather desperate I would
> try this. Some example code for drawing to get you started:
>
>> for(int j = 0; j < dGeomTriMeshGetTriangleCount(geomObj); j++)
>> {
>>                 dVector3 p1, p2, p3;
>>                 dGeomTriMeshGetTriangle( geomObj, j, &p1, &p2, &p3 );
>>                 //DrawTriangle Code
>> }
>
>
> Greetings,
> Lode
>
> arturapps wrote:
>
>>Hi people:
>>
>>I´m working on a game that doesn´t need Real time physics  but needs
>>Trimesh-Trimesh colision Detection .
>>
>>The game is a kind  of spaceship race that takes place on a  quite large
>>enviromment composed of trimeshes.
>>
>>I´m  experiencing all kind of problems with my collisions : Since false
>>collisions , until  missed collisions. Sometimes  the near callback is not
>>triggered even if two trimeshes visually collide.
>>
>>I examined ODE´s documentation and figured out that  it´s possible to use
>>just the colision detection capabilitys of ODE.  So my sojtware does not
>>create the "word"  and any body   for physics  processing. The ODE´s
"step"
>>of simulation is not called.  The software just create the colision space
>>and associate   geoms ( trimeshes ) to  the game entitys .
>>
>>That´s the way the game works:
>>
>>Create collision space
>>Create Entytys and associated geoms ( trimeshes)
>>
>>(Loop)
>>{
>>Call Entity´s IA  // Each entity decide about its next movement and then
>>modify it´s position and  orientation
>>modify entity´s geoms // based on entity´s  position and orientation
>>call colision detection (dSpaceCollide)
>>Draw
>>}
>>
>>(nearCallback)
>>{
>> call dcollide  to get contact points between the colision pair
>>iinform the entitys associated with the colision geoms , about the
colision
>>points
>>//In the next loop the Entity´s IA will do something as colision response
>>}
>>
>>
>>Well ... first of all , I´d like to know if is that aproach correct. IS
>>there any problem using just colilision detection system  of ode ?
>>
>>By the way : I´m using  the version of ODE , that uses GIMPACT instead of
>>http://sourceforge.net/project/showfiles.php?group_id=176661&package_id=208772&release_id=458193
>>
>>In second place : I´d like to describe some tests I made to be sure that
my
>>trimeshes and trimesh creation process are correct:
>>
>>I  changed the test_moving_trimesh example that comes with the
ODE-Gimpact
>>project, in order to create the trimeshes from my model file format ,
>>instead of creating the "bunnys" on the code.  I didn´t changed the way it
>>does trimesh creation because it was the same way I do it . So I could
>>notice that my trimesh models work very well . they are displayed
correctly
>>and collyde very well.  So I discarded problems about vertex order or
normal
>>orientation.
>>
>>In my software I don´t call dGeomTriMeshSetLastTransform in order to
update
>>temporal coerence for the Geoms.
>>I removed all calls of  dGeomTriMeshSetLastTransform from the
>>test_moving_trimesh example  and than I noticed that it does not afect
>>colisions , but only the quality of physics simulation.
>>
>>So I don´t know what I can do next  in order to understand my problem ?
>>
>>
>>
>>
>>
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>
>

--
View this message in context: http://www.nabble.com/Im-totally-unhappy-with-ODE-...-Please-Help-me-tf2829364.html#a7915632
Sent from the ODE mailing list archive at Nabble.com.

```