Example usage for javax.media.j3d BranchGroup setBoundsAutoCompute

List of usage examples for javax.media.j3d BranchGroup setBoundsAutoCompute

Introduction

In this page you can find the example usage for javax.media.j3d BranchGroup setBoundsAutoCompute.

Prototype

public void setBoundsAutoCompute(boolean autoCompute) 

Source Link

Document

Turns the automatic calcuation of geometric bounds of a node on/off.

Usage

From source file:CompileTest.java

protected BranchGroup createSceneBranchGroup() {
    BranchGroup objRoot = super.createSceneBranchGroup();

    // do NOT auto compute bounds for this node
    objRoot.setBoundsAutoCompute(false);

    TransformGroup objTrans = new TransformGroup();
    objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);

    Transform3D yAxis = new Transform3D();
    Alpha rotationAlpha = new Alpha(-1, Alpha.INCREASING_ENABLE, 0, 0, 4000, 0, 0, 0, 0, 0);

    RotationInterpolator rotator = new RotationInterpolator(rotationAlpha, objTrans, yAxis, 0.0f,
            (float) Math.PI * 2.0f);

    rotator.setSchedulingBounds(createApplicationBounds());
    objTrans.addChild(rotator);//from   w  w  w.j  a va 2  s.co m

    objTrans.addChild(createColorCubes());

    objRoot.addChild(objTrans);

    return objRoot;
}

From source file:BoundsTest.java

protected BranchGroup createSceneBranchGroup() {
    BranchGroup objRoot = super.createSceneBranchGroup();

    // do NOT auto compute bounds for this node
    objRoot.setBoundsAutoCompute(false);

    TransformGroup objTrans = new TransformGroup();
    objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);

    Transform3D yAxis = new Transform3D();
    Alpha rotationAlpha = new Alpha(-1, Alpha.INCREASING_ENABLE, 0, 0, 4000, 0, 0, 0, 0, 0);

    RotationInterpolator rotator = new RotationInterpolator(rotationAlpha, objTrans, yAxis, 0.0f,
            (float) Math.PI * 2.0f);

    rotator.setSchedulingBounds(createApplicationBounds());
    objTrans.addChild(rotator);//from  ww  w  .j  av  a2  s .  c o m

    objTrans.addChild(createColorCubes());
    objTrans.addChild(createPoints());

    objRoot.addChild(objTrans);

    return objRoot;
}