Mario - 

I use the orbit behavior and the Transform3D "lookAt" in my application with OK 
results. I have included some code snippets below, but I don't think I am doing 
anything special. You need to do two things: update the orbit behavior focus point, 
and update the view platform transform group. Hope this helps.

Matt




    !!! IMPLEMENTING CLASS VARIABLES !!!

    protected SimpleUniverse univ;
    protected OrbitBehavior ob;
 
    !!! METHOD TO UPDATE ORBIT BEHAVIOR & VIEW PLATFORM ORIENTATION !!!!

    private void setView(Point3d eye, Point3d focus, Vector3d up, boolean autoSize) {
        
        if (autoSize) {
            
            // Modify the eye position by changing the distance from the focus 
            // point, while retaining the direction from the specified eye to 
            // focus points, so that the bounding box around the mode is within 
            // the field of view of the view. 
        
            !!!!! CUT - OFF TOPIC CODE !!!!!
                        
        }
       
        // Create a Transform3d object, and set it to look at the focus point 
        // from the eye position with the specified up vector.
        Transform3D initial = new Transform3D();
        initial.lookAt(eye, focus, up);
        initial.invert();
        
        // update the orbit behavior center of movement to coorespond to the 
        // focus position we just set.
        ob.setRotationCenter(focus);
        
        // Set the transform for the viewplatform using this transformation matrix
        TransformGroup vpTG = univ.getViewingPlatform().getViewPlatformTransform();
        vpTG.setTransform(initial);
        
    }

-----Original Message-----
From: ZACZEK, MARIUSZ P. (MARIO) (JSC-DM) (NASA)
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 02, 2003 11:13 AM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] ? OrbitBehavior and LookAt ?


If you use 'OrbitBehavior' is there a way to also use the 'lookAt' function
of
the viewing transform3d correctly? Does anyone have any example code?

I can use the OrbitBehavior but once I do a single rotation of my view and
then
try to use the lookAt function to set my view I don't get the proper result.


Please give me some suggestions.

   Mario

Mariusz Zaczek
NASA - Johnson Space Center
Automated Vehicles and Orbit Analysis / DM35
Flight Design and Dynamics Division
Mission Operations Directorate
Bldg: 30A     Room: 3040A

Disclaimer: "The opinions, observations and comments expressed in my email
             are strictly my own and do not necessarily reflect those of
NASA."

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