EulerRotation

Programming Reality Factory and Genesis3D.
Post Reply
Nout
Posts: 136
Joined: Tue Jul 05, 2005 5:14 pm

EulerRotation

Post by Nout » Tue Aug 16, 2005 7:01 pm

I've still a problem with getting the correct match in rotations in the Tokamak matrix and the Genesis rotations

I see 2 ways to get the correct result:
a) read and write directly into the 4*4 matrix of an actor

I've tried this, but for some reason it does not work

//Added by Nout Aug 2005
GENESISAPI void GENESISCC geActor_GetTransform(geActor *A, geXForm3d *Transform)
{
assert( geActor_IsValid(A) != GE_FALSE );
assert ( (Transform==NULL) || (geXForm3d_IsOrthonormal(Transform) != GE_FALSE) );
gePose_GetJointTransform( A->Pose, A->BoundingBoxCenterBoneIndex, Transform);
}
//End added by Nout

//Added by Nout Aug 2005
GENESISAPI void GENESISCC geActor_SetTransform(geActor *A, geXForm3d *Transform)
{
assert( geActor_IsValid(A) != GE_FALSE );
assert ( (Transform==NULL) || (geXForm3d_IsOrthonormal(Transform) != GE_FALSE) );
gePose_Clear(A->Pose, Transform);
}
//End added by Nout

Can somebody help me to directly read and write into the root matrix (4*4) of an actor?

A second way is to use the EulerRotation functions, but also there I have a small problem...

I've set up all using the Euler functions + request Tokamak to spin a box around its center, and I do this axis by axis
- The box spins nice and as expected around the X-axis
- The box spins nice and as expected around the Z-axis
- But for the Y-axis rotation, the box spins 180degrees around the Y-axis and then the direction suddenly changes and it returns 180 degrees...
What I need is that the box stays spinning forever in the same direction

Any idea what I do wrong?

The first option is faster, and sure preferred over the EulerRotation

Post Reply