Hi all,

If anyone is interested in the solution for the strange behavior:

In one case the Transformation of the object is updated depending on the frame rate 
because the
difference matrix is multiplied in the behavior and generates a new transformation 
every frame.
In the other case the Transformation of the object is updated depending on input 
device scheduler
rate since the absolute transformation is calculated in the input device 
implementation.
So depending which thread runs faster the objects are moving with different speed.

So there is a difference if an input device delivers absolute data or relative data. 
Maybe this is
of some importance wen using more than one input device. Put it in the FAQ  or 
documentation ?

Paul

Kelvin Chung schrieb:

> Hi Paul,
>
>    If you are using the v1.2.1 release, there are two bugs
>
>    4430366 - Transform3D invert() is numerically unstable when matrix is congruent
>    4430638 - Congruent classification is numerically unstable
>
> which may cause the problem.  Please update your Java3D version to use
> v1.2.1_01 release.
>
> Thanks.
>
> - Kelvin
> --------------
> Java 3D Team
> Sun Microsystems Inc.
>
> >X-Unix-From: [EMAIL PROTECTED]  Thu May  3 03:08:46 2001
> >X-Warning: VM230.AKH-WIEN.AC.AT: Host lymnaea.imc.akh-wien.ac.at claimed to be 
>akh-wien.ac.at
> >X-Accept-Language: de
> >MIME-Version: 1.0
> >Content-Transfer-Encoding: 7bit
> >Date: Thu, 3 May 2001 11:58:56 +0200
> >From: "Dipl. Ing. Paul Szawlowski" <[EMAIL PROTECTED]>
> >Subject: [JAVA3D] InputDevices and Behavior
> >To: [EMAIL PROTECTED]
> >
> >Hi all,
> >
> >Maybe someone can give me a hint. I've observed a strange behavior with
> >an input device with different calculations of the input values.
> >
> >one way is like that (multiplying a difference matrix in the behavior):
> >
> >code in InputDevice implementation:
> >
> >{
> >    // itsPositionValues: values read from the 6DOF of freedom device
> >      final double sinXrot = Math . sin( itsPositionValues[ 3 ] );
> >      final double sinYrot = Math . sin( itsPositionValues[ 4 ] );
> >      final double sinZrot = Math . sin( itsPositionValues[ 5 ] );
> >      final double cosXrot = Math . cos( itsPositionValues[ 3 ] );
> >      final double cosYrot = Math . cos( itsPositionValues[ 4 ] );
> >
> >      itsPosition . set( itsPositionValues[ 0 ], itsPositionValues[ 1 ],
> >itsPositionValues[ 2 ] );
> >      itsOrientation . set( sinYrot * cosXrot, sinXrot, - cosYrot *
> >cosXrot );
> >      itsUpVector . set
> >         (
> >            - sinYrot * sinXrot + cosYrot * cosXrot * sinZrot
> >         ,  cosXrot + sinXrot * sinZrot
> >         ,  cosYrot * sinXrot - sinYrot * cosXrot * sinZrot
> >         );
> >      itsTransform . lookAt( itsZeroPoint, itsOrientation, itsUpVector
> >);
> >      itsTransform . setTranslation( itsPosition );
> >      writeSensor( itsTransform, getButtonValues( ) );
> >}
> >
> >code in behavior:
> >{
> >      if( itsTG != null ) // itsTG is a TransfromGroup
> >      {
> >         itsTG . getTransform( itsTempTransform );
> >         itsTempTransform . get( itsTransVector );
> >         itsTempTransform . getRotationScale( itsRotMatrix );
> >         itsNewTransform . set( itsTransVector );
> >         itsSensor . getRead( itsTempTransform );
> >         itsNewTransform . mul( itsTempTransform );
> >         itsTempTransform . set( itsRotMatrix );
> >         itsNewTransform . mul( itsTempTransform );
> >         itsTG . setTransform( itsNewTransform );
> >      }
> >      wakeupOn( itsWakeup ); // wake up every frame
> >}
> >
> >-----------------------------------------------------------------------------------
> >
> >the other way is like that (using a difference vector and calculate
> >absolute matrix)
> >
> >code in InputDevice implementation
> >
> >{
> >      double[ ] positionValues = getPositionValues( );
> >      final double sinXrot = Math . sin( positionValues[ 3 ] );
> >      final double sinYrot = Math . sin( positionValues[ 4 ] );
> >      final double sinZrot = Math . sin( positionValues[ 5 ] );
> >      final double cosXrot = Math . cos( positionValues[ 3 ] );
> >      final double cosYrot = Math . cos( positionValues[ 4 ] );
> >
> >      itsPosition . x += positionValues[ 0 ];
> >      itsPosition . y += positionValues[ 1 ];
> >      itsPosition . z += positionValues[ 2 ];
> >
> >      itsDirection . set( sinYrot * cosXrot, sinXrot, - cosYrot *
> >cosXrot );
> >      itsUpVector . set
> >         (
> >            - sinYrot * sinXrot + cosYrot * cosXrot * sinZrot
> >         ,  cosXrot + sinXrot * sinZrot
> >         ,  cosYrot * sinXrot - sinYrot * cosXrot * sinZrot
> >         );
> >
> >      itsTransform . getRotationScale( itsTempMatrix ); // itsTransform
> >holds the current transformation
> >      itsTempMatrix . transpose();
> >      itsTempMatrix . transform( itsDirection );
> >      itsTempMatrix . transform( itsUpVector );
> >      itsTransform . lookAt( itsTempPosition, itsDirection, itsUpVector
> >);
> >      itsTransform . setTranslation( itsPosition );
> >      writeSensor( itsTransform, getButtonValues( ) );
> >}
> >
> >code in behavior:
> >
> >{
> >      if( itsTG != null )
> >      {
> >         itsSensor . getRead( itsTransform );
> >         itsTG . setTransform( itsTransform );
> >      }
> >      wakeupOn( itsWakeup );
> >}
> >
> >In my opinion both methods should have the same result. But the object
> >moves faster with the first method than with the second method. I
> >measured frame rate and InputDevice scheduler rate which are pretty much
> >the same. So only the stepwidth of the transformation can be different,
> >but why ?
> >
> >regards
> >Paul
> >
> >===========================================================================
> >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".
>
> ===========================================================================
> 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".

===========================================================================
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