Ah, I see the problem. The rotation center returned from OrbitBehavior does not include any of the translation components. If you update the getRotationCenter method in OrbitBehavior to this you should get the desired result. public void getRotationCenter(Point3d center) { center.x = rotationCenter.x+xtrans; center.y = rotationCenter.y+ytrans; center.z = rotationCenter.z; } Rgds Paul ---------------------------------------------------------- Paul Byrne Email : [EMAIL PROTECTED] Sun Microsystems Phone : (650) 786 9926 Visualization Software Group Fax : (650) 786 5852 ---------------------------------------------------------- >Given a simple scene with an OrbitBehavior attached to the >viewplatform, I want to be able to open a new frame and put a clone of >the scene in there. So I create a new SimpleUniverse, copy the >Transform3d of the original ViewPlatform into the new >ViewPlatformTransform and copy the rotation center the same way >between the orbit behaviors. >If I click in the new canvas (and trigger the orbit behavior) and the >original scene was translated before cloning, you can see the scene in >the new canvas jump to another position (rotation and zoom are >preserved). >You see, I want methods to get and set the translational state of the >OrbitBehavior. But if it's possible to initialize the behavior only >from the target transform, I think this should be done within the >resetViewPosition method. > >Regards, > >Ingo > >>The OrbitBehavior does take into account any translation changes to >>the view Transform, the view will be positioned at the translated >>point but will always point to the rotation center. >> >>Java 3D Fly Through uses this functionality for the 'Show All' >>command. >> >>How does this differ from your requirements ? >> >>As a side note, the resetViewPosition method should not be made >>public as that would require user code to have knowledge about which >>ViewPlatformBehavior is currently driving the view. >> >>Rgds >> >>Paul >> >>---------------------------------------------------------- >>Paul Byrne Email : [EMAIL PROTECTED] Sun Microsystems Phone : (650) >>786 9926 Visualization Software Group Fax : (650) 786 5852 >>---------------------------------------------------------- >> >> >> >>>I had a look at the source of the OrbitBehavior class that is coming >>>with Java 3D 1.2.1_01. It has a private method called >>>resetViewPosition(), which is called when the behavior is attached >>>to the Viewplatform or when the target transform is changed. It >>>changes the internal state of the OrbitBehavior, so that it works >>>perfectly when you change the rotation and zoom of the target >>>transfrom, but it does not take translations into account!!! I know >>>it's no simple mathematics, but is it not possible to reset the >>>translation as well? I wished the guy at SUN, who is responsible >>>for this class, could implement this. >>> >>>Regards, >>> >>>Ingo > >=========================================================================== >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".
*************************************************************** "Copyright (c) 2001 Sun Microsystems, Inc. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistribution in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of Sun Microsystems, Inc. or the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. This software is provided "AS IS," without a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. You acknowledge that Software is not designed,licensed or intended for use in the design, construction, operation or maintenance of any nuclear facility." ****************************************************************************