Examples of RotationInterpolator


Examples of javax.media.j3d.RotationInterpolator

    Alpha boxAlpha = new Alpha(1,2000);

    //The starting time is first postponed until "infinity".
    boxAlpha.setStartTime(Long.MAX_VALUE);

    RotationInterpolator boxRotation = new RotationInterpolator(boxAlpha,tgmBox,
                                             rotationAxis,0.0f,(float) Math.PI*2);

    BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0),Double.MAX_VALUE);
    boxRotation.setSchedulingBounds(bounds);

    //The movement is added to the transformation group.
    tgmBox.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    tgmBox.addChild(boxRotation);

View Full Code Here

Examples of javax.media.j3d.RotationInterpolator

    tfmLight.addChild(light);

    //The Alpha for the rotation.
    Alpha alphaLight = new Alpha(-1,4000);
    //The rotation.
    RotationInterpolator rot = new RotationInterpolator(alphaLight,tfmLight,
                                                        new Transform3D(),
                                                         0.0f,(float) Math.PI*2);
    rot.setSchedulingBounds(bounds);

    tfmLight.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    tfmLight.addChild(rot);

    bgLight.addChild(tfmLight);
View Full Code Here

Examples of javax.media.j3d.RotationInterpolator

    Alpha boxAlpha = new Alpha(1,2000);

    //Set the starting time of the rotation to infinity.
    boxAlpha.setStartTime(Long.MAX_VALUE);

    RotationInterpolator boxRotation = new RotationInterpolator(boxAlpha,tgmBox,
                                             rotationAxis,0.0f,(float) Math.PI*2);

    BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0),100.0);
    boxRotation.setSchedulingBounds(bounds);

    //Add the rotation to the corresponding transform group.
    tgmBox.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    tgmBox.addChild(boxRotation);

View Full Code Here

Examples of javax.media.j3d.RotationInterpolator

    tfmLight.addChild(lightSpot);

    //The Alpha for the rotation.
    Alpha alphaLight = new Alpha(-1,4000);
    //The rotation
    RotationInterpolator rot = new RotationInterpolator(alphaLight,tfmLight,
                                                        new Transform3D(),
                                                         0.0f,(float) Math.PI*2);
    rot.setSchedulingBounds(bounds);

    tfmLight.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    tfmLight.addChild(rot);

    bgLight.addChild(tfmLight);
View Full Code Here

Examples of javax.media.j3d.RotationInterpolator

    tfmLight.addChild(light);

    //The Alpha for the rotation.
    Alpha alphaLight = new Alpha(-1,4000);
    //The rotation
    RotationInterpolator rot = new RotationInterpolator(alphaLight,tfmLight,
                                                        new Transform3D(),
                                                         0.0f,(float) Math.PI*2);
    rot.setSchedulingBounds(bounds);

    tfmLight.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    tfmLight.addChild(rot);

    bgLight.addChild(tfmLight);
View Full Code Here

Examples of javax.media.j3d.RotationInterpolator

                                              0,timeSlowRotation,0,0,0,0,0);



    //The slow rotation.
    RotationInterpolator bladeRotationStart = new RotationInterpolator(
                                             bladeRotationStartAlpha,tgmRotor,
                                             bladeRotationAxis,0.0f,(float) Math.PI*2);

    BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0),Double.MAX_VALUE);
    bladeRotationStart.setSchedulingBounds(bounds);



    int timeFastRotation = 500; //A fast rotation takes 0.5 seconds.
    int timeOneWayFlight = 2000;//The helicopter rises within 2 seconds.
    int timeHovering = 1000;//It shall hover for one second.
    int timeStartWait = 1000;//The helicopter should start its flight when the rotor
                             //blade has been rotating fast for one second.

    //The overall time when the helicopter should start its flight.
    int timeFlightStart = timeStartRotor+timeSlowRotation*noStartRotations+timeStartWait;
    //Number of fast rotations.
    int noFastRotations = 1+ ((timeStartWait+2*timeOneWayFlight+timeHovering)/timeFastRotation);

    //The Alpha for the fast rotations.
    Alpha bladeRotationAlpha = new Alpha(noFastRotations,Alpha.INCREASING_ENABLE,
                                         timeStartRotor+timeSlowRotation*noStartRotations,
                                         0,timeFastRotation,0,0,0,0,0);


    //The fast rotation.
    RotationInterpolator bladeRotation = new RotationInterpolator(
                                             bladeRotationAlpha,tgmRotor,
                                             bladeRotationAxis,0.0f,(float) Math.PI*2);
    bladeRotation.setSchedulingBounds(bounds);


    //The slow and the fast rotation are assigned to the transformation group
    //of the rotor blade. These rotations are carried out in the origin so far.
    //The later transformations will place everything correctly.
View Full Code Here

Examples of javax.media.j3d.RotationInterpolator

/*    */
/*    */   public void writeObject(DataOutput out) throws IOException
/*    */   {
/* 62 */     super.writeObject(out);
/*    */
/* 64 */     RotationInterpolator interp = (RotationInterpolator)this.node;
/* 65 */     out.writeFloat(interp.getMinimumAngle());
/* 66 */     out.writeFloat(interp.getMaximumAngle());
/*    */   }
View Full Code Here

Examples of javax.media.j3d.RotationInterpolator

/*    */   }
/*    */
/*    */   public void readObject(DataInput in) throws IOException {
/* 70 */     super.readObject(in);
/*    */
/* 72 */     RotationInterpolator interp = (RotationInterpolator)this.node;
/* 73 */     interp.setMinimumAngle(in.readFloat());
/* 74 */     interp.setMaximumAngle(in.readFloat());
/*    */   }
View Full Code Here

Examples of javax.media.j3d.RotationInterpolator

/* 78 */     return createNode(j3dClass, new Class[] { Alpha.class, TransformGroup.class }, new Object[] { null, null });
/*    */   }
/*    */
/*    */   protected SceneGraphObject createNode()
/*    */   {
/* 83 */     return new RotationInterpolator(null, null);
/*    */   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.