Hi, everyone:
I am having problem using Clip node. I tried to use it to change the back
clip distance for a compiled scene. But once I attached it to the scene
branchgroup, the clip distance is set to default (10 meters) in stead of
the value I specified. It looks like the node is totally ignored by J3d. My
simplified code is shown as follows. My questions are 1. can I use the clip
node to change the back clip distance of a live scene? 2. what did I do wrong?
Thanks in advance!!
Lan
BranchGroup objRoot = new BranchGroup();
objTransformGroup = new TransformGroup();
Vector3f translate = new Vector3f();
Transform3D t3d = new Transform3D();
t3d.setTranslation( translate );
objTransformGroup.setTransform( t3d );
objRoot.addChild( objTransformGroup);
ViewingPlatform viewingP = simpleU.getViewingPlatform();
viewingP.getViewPlatform().setActivationRadius( 750.0f );
BoundingLeaf boundingLeaf = new BoundingLeaf( bounds );
objTransformGroup.addChild( boundingLeaf );
// add direct light and embient light
objTransformGroup.addChild( dirLight );
... ...;
// - Define a background, set the background color and its application
bounds
Background background = new Background();
background.setColor( SFColor.bkground );
background.setApplicationBoundingLeaf(boundingLeaf);
objTransformGroup.addChild( background );
// add clip node
Clip clipLeaf = new Clip(40.d);
clipLeaf.setApplicationBoundingLeaf(boundingLeaf);
clipLeaf.setCapability(Clip.ALLOW_BACK_DISTANCE_WRITE );
objTransformGroup.addChild(clipLeaf);
Lan Wu-Cavener
Research Associate and Programmer
Dept. of Landscape Architecture
===========================================================================
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".