Florin is right.
 But if you are tied to Euler angles, specially at initial and final position,
you can do something like:

// euler2Quat is method to convert a Tuple3f to Quat4f
 Quat4f qInit = euler2Quat(initAngle);
 Quat4f qEnd  = euler2Quat(endAngle);
 Quat4f qMid =  new Quat4f();

  // intermediate angle is abtained by quaternion interpolation
  // position is a float value between 0.0f (init) and 1.0f(end)
  qMid.interpolate(qInit, qEnd, position)


Of course this have limited use. Check if it fit your needs.
Good luck
Alessandro

--- Florin Herinean <[EMAIL PROTECTED]> escreveu:
> MessageThere is obviously no difference since you're still using quaternions
> like euler angles. In other words, as long as you use pitch/yaw/roll you're
> always have gimbal locks, regardless of what intermediate transformations
> you use. If you don't want gimbal locks, just stop using them.
>
> Cheers,
>
> Florin
>   -----Ursprüngliche Nachricht-----
>   Von: Discussion list for Java 3D API
> [mailto:[EMAIL PROTECTED] Auftrag von Cavill, SA (Stuart)
>   Gesendet: Mittwoch, 25. August 2004 15:19
>   An: [EMAIL PROTECTED]
>   Betreff: [JAVA3D] Gimbal lock
>
>
>   Hi,
>   I'm having problems with Gimbal Lock in my JAVA 3D code ( all I need to do
> is rotate a simple cube in 3 dimensions).
>   I initially used
>
>   transx.rotX(anglex);
>   transy.rotX(angley);
>   transz.rotX(anglez);
>   trans4m.set(transx);
>   trans4m.mul(transy);
>   trans4m.mul(transz);
>   transformGroup.setTransform(trans4m);
>
>   which caused gimbal lock
>
>   I then tried to use
>   public Quat4f setQ(float pitch, float yaw, float roll)
>   {
>     Quat4f qx =new Quat4f((float)
> Math.cos(pitch/2f),(float)Math.sin(pitch/2f),0,0);
>     Quat4f qy =new Quat4f((float)
> Math.cos(yaw/2f),0,(float)Math.sin(yaw/2f),0);
>     Quat4f qz =new Quat4f((float)
> Math.cos(roll/2f),0,0,(float)Math.sin(roll/2f));
>     Quat4f qt =new Quat4f();
>     qt.set(qx);
>     qt.mul(qy);
>     qt.mul(qz);
>     return(qt);
>
>   }
>   trans4m.set(q2);
>   transformGroup.setTransform(trans4m);
>
>   but again gimbal lock occurred.
>
>   I would appreciate any comments on what I am doing wrong or seeing an
> example of the correct way to go about this problem without gimbal lock
> occurring.
>   Any help would be greatly appreciated.
>
>   regards
>
>
>   Stuart Cavill
>   email: [EMAIL PROTECTED]
>






_______________________________________________________
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade!
http://br.acesso.yahoo.com/

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to