Dear Ben,

> The problem I'm having is that I want the OrbitBehaviour to
> rotate around the Y-axis of the scene but instead it is rotating
> around the Y-Axis of the ViewPlatform. Because the ViewPlatform
> is pointing down towards the origin, it ends up rotating through
> the floor of the scene, rather than rotating around it in a flat
> plane.

This is what I've called 'drunken' behavior before (more than once)
and I suggested an additional flag to the constructor to achieve
the upright rotation ... without any response.

What you can do is: copy the code of OrbitBehavior to your own
package and change just one line inside integrateTransforms()
(marked with <--- / <===, // comments by me):

        longditudeTransform.rotY( longditude );
        latitudeTransform.rotX( latitude );
        rotateTransform.mul(rotateTransform, latitudeTransform);
        // original code as found in OrbitBehaviour J3D 1.3beta2
//        rotateTransform.mul(rotateTransform, longditudeTransform); //<-----

        // changed code to maintain an 'upright' behaviour, meaning:
        // the horizon will be kept horizontal or stated another way:
        // the 3D world Y axis ever is projected to a vertical line in 2D.
        // Note, that the Y axis projection actually may appear upside down,
        // but ever being vertical, avoiding the 'drunken behavior' of the
        // original OrbitBehaviour.
        //
        // One improvement would be to restrict the Y axis turn, so that the world
        // can't be viewed upside down.
        rotateTransform.mul(longditudeTransform, rotateTransform);   //<=====

        distanceVector.z = distanceFromCenter - startDistanceFromCenter;

It's a pitty, but you can't just subclass OrbitBehavior, too many
members you need are private.

Hope this helps

Georg
 ___   ___
| + | |__    Georg Rehfeld      Woltmanstr. 12     20097 Hamburg
|_|_\ |___   [EMAIL PROTECTED]           +49 (40) 23 53 27 10

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