//we actually want our transformgroup to control the viewing platform

                //we want the view platform to be associated with the camera
transform
                //because when we move the camera around, we want to see that
part of the world

                ViewPlatform viewPlatform = new ViewPlatform();

                //reset the camera and the position transforms
                mCameraTransform = new TransformGroup();

mCameraTransform.setCapability(TransformGroup.ALLOW_CHILDREN_READ);

mCameraTransform.setCapability(TransformGroup.ALLOW_CHILDREN_WRITE);

mCameraTransform.setCapability(TransformGroup.ALLOW_CHILDREN_EXTEND);

mCameraTransform.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);

mCameraTransform.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);


                mCameraTransform.addChild(viewPlatform);

                sceneRoot.setCapability(BranchGroup.ALLOW_CHILDREN_READ);
                sceneRoot.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);
                sceneRoot.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);

                //vpBGRoot is the branchgroup root of the viewable scene graph
                sceneRoot.addChild(vpBGRoot);
                //the camera transform is what moves the view platform around
                sceneRoot.addChild(mCameraTransform);


                //weird how Java3d has ViewPlatform, ViewingPlatform..
                //why not VeiwingContainer? or something like that? oh well.
                ViewingPlatform viewplat = new ViewingPlatform();
                viewplat.setViewPlatform(viewPlatform);


                //set up the simple universe and add in our view platform and
set our back clip distance
                s_u = new SimpleUniverse(s_c);
                s_u.getViewer().setViewingPlatform(viewplat);

                s_u.getViewer().getView().setBackClipDistance(100);

                //let's go live!

                s_u.addBranchGraph(sceneRoot);

Scott Decker
Research Scientist
Pacific Northwest National Labs
[EMAIL PROTECTED]
please feed the squirrels

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