Examples of Alpha


Examples of javax.media.j3d.Alpha

    //The transformation group for the directional light and its rotation.
    TransformGroup tfmLight = new TransformGroup();
    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);
View Full Code Here

Examples of javax.media.j3d.Alpha

    int timeStartRotor = 2000; //The rotor blade should start to turn after 2 seconds.
    int noStartRotations = 2//First, two slow rotations are carried out.
    int timeSlowRotation = 1500;//A slow rotation takes 1.5 seconds.

    //The Alpha for the slow rotation.
    Alpha bladeRotationStartAlpha = new Alpha(noStartRotations,
                                              Alpha.INCREASING_ENABLE,
                                              timeStartRotor,
                                              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.
    tgmRotor.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    tgmRotor.addChild(bladeRotationStart);
    tgmRotor.addChild(bladeRotation);


//*** The transformation group to position the rotor blade on top of the cockpit. ***
    //The rotation of the rotor blade will therefore also take place om top
    //of the cockpit.
    Transform3D tfRotor = new Transform3D();
    tfRotor.setTranslation(new Vector3f(0.0f,cabinRadius,0.0f));
    TransformGroup tgRotor = new TransformGroup(tfRotor);
    tgRotor.addChild(tgmRotor);



//*** The tail of the helicopter. ***

    //Length of the tail.
    float halfTailLength = 0.2f;

    //Generate the tail in form of a green box.
    Box tail = new Box(halfTailLength,0.02f,0.02f,greenApp);

    //A transformation placing the tail at the end of the cockpit.
    Transform3D tfTail = new Transform3D();
    tfTail.setTranslation(new Vector3f(cabinRadius+halfTailLength,0.0f,0.0f));

    //The transformation group for the tail.
    TransformGroup tgTail = new TransformGroup(tfTail);
    tgTail.addChild(tail);



//*** The transformation group for the flight of the helicopter. ***
    //The flight is carried out with respect to the origin. Later on, the helicopter
    //including its movement will be placed onto the platform.
    TransformGroup tgmHelicopter = new TransformGroup();

    //Add all parts of the helicopter.
    tgmHelicopter.addChild(tgCabin);
    tgmHelicopter.addChild(tgRotor);
    tgmHelicopter.addChild(tgTail);

    //Define the movement for the flight.
    int timeAcc = 300; //The acceleration and breaking phase should last 0.3 seconds.
    //The helicopter fly slightly of from the vertical axis.
    Transform3D helicopterFlightAxis = new Transform3D();
    helicopterFlightAxis.rotZ(0.4*Math.PI);

    //The Alpha for the flight of the helicopter.
    Alpha helicopterAlpha = new Alpha(1,Alpha.INCREASING_ENABLE+Alpha.DECREASING_ENABLE,
                                      timeFlightStart,0,timeOneWayFlight,timeAcc,
                                      timeHovering,timeOneWayFlight,timeAcc,0);



View Full Code Here

Examples of javax.media.j3d.Alpha

        float[] knots = new float[] { 0, 1 };
        Point3f position1 = new Point3f(translationVector.getX(), translationVector.getY(), translationVector.getZ());
        Point3f position2 = ProjectionHelper.getProjectionPoint(position1);
        Point3f[] positions = new Point3f[] { position1, position2 };
        Quat4f[] rotations = new Quat4f[] { rotationQuat, rotationQuat };
        Alpha alpha = new Alpha(1, (long) (translationVector.getY() * 1000));
        alpha.setStartTime(System.currentTimeMillis());
        RotPosPathInterpolator gravity = new RotPosPathInterpolator(alpha, newTransformGroup, new Transform3D(), knots,
                rotations, positions);
        gravity.setSchedulingBounds(new BoundingSphere());
        return gravity;
    }
View Full Code Here

Examples of javax.media.j3d.Alpha

/* 53 */     super(symbol, control);
/*    */   }
/*    */
/*    */   public void writeObject(DataOutput out) throws IOException {
/* 57 */     super.writeObject(out);
/* 58 */     Alpha alpha = (Alpha)this.node;
/* 59 */     out.writeLong(alpha.getAlphaAtOneDuration());
/* 60 */     out.writeLong(alpha.getAlphaAtZeroDuration());
/* 61 */     out.writeLong(alpha.getDecreasingAlphaDuration());
/* 62 */     out.writeLong(alpha.getDecreasingAlphaRampDuration());
/* 63 */     out.writeLong(alpha.getIncreasingAlphaDuration());
/* 64 */     out.writeLong(alpha.getIncreasingAlphaRampDuration());
/* 65 */     out.writeInt(alpha.getLoopCount());
/* 66 */     out.writeInt(alpha.getMode());
/* 67 */     out.writeLong(alpha.getPhaseDelayDuration());
/* 68 */     out.writeLong(alpha.getStartTime());
/* 69 */     out.writeLong(alpha.getTriggerTime());
/* 70 */     out.writeLong(alpha.getPauseTime());
/*    */   }
View Full Code Here

Examples of javax.media.j3d.Alpha

/* 70 */     out.writeLong(alpha.getPauseTime());
/*    */   }
/*    */
/*    */   public void readObject(DataInput in) throws IOException {
/* 74 */     super.readObject(in);
/* 75 */     Alpha alpha = (Alpha)this.node;
/* 76 */     alpha.setAlphaAtOneDuration(in.readLong());
/* 77 */     alpha.setAlphaAtZeroDuration(in.readLong());
/* 78 */     alpha.setDecreasingAlphaDuration(in.readLong());
/* 79 */     alpha.setDecreasingAlphaRampDuration(in.readLong());
/* 80 */     alpha.setIncreasingAlphaDuration(in.readLong());
/* 81 */     alpha.setIncreasingAlphaRampDuration(in.readLong());
/* 82 */     alpha.setLoopCount(in.readInt());
/* 83 */     alpha.setMode(in.readInt());
/* 84 */     alpha.setPhaseDelayDuration(in.readLong());
/* 85 */     alpha.setStartTime(in.readLong());
/* 86 */     alpha.setTriggerTime(in.readLong());
/* 87 */     long x = in.readLong();
/* 88 */     if (x != 0L) alpha.pause(x);
/*    */   }
View Full Code Here

Examples of javax.media.j3d.Alpha

/* 88 */     if (x != 0L) alpha.pause(x);
/*    */   }
/*    */
/*    */   protected SceneGraphObject createNode()
/*    */   {
/* 92 */     return new Alpha();
/*    */   }
View Full Code Here

Examples of javax.media.j3d.Alpha

        float[] knots = new float[] { 0, 1 };
        Point3f position1 = new Point3f(translationVector.getX(), translationVector.getY(), translationVector.getZ());
        Point3f position2 = ProjectionHelper.getProjectionPoint(position1);
        Point3f[] positions = new Point3f[] { position1, position2 };
        Quat4f[] rotations = new Quat4f[] { rotationQuat, rotationQuat };
        Alpha alpha = new Alpha(1, (long) (translationVector.getY() * 1000));
        alpha.setStartTime(System.currentTimeMillis());
        RotPosPathInterpolator gravity = new RotPosPathInterpolator(alpha, newTransformGroup, new Transform3D(), knots,
                rotations, positions);
        gravity.setSchedulingBounds(new BoundingSphere());
        return gravity;
    }
View Full Code Here

Examples of org.jboss.test.xb.builder.object.type.accessor.support.Alpha

      super(name);
   }

   public void testUnmarshal() throws Exception
   {
      Alpha alpha = unmarshalObject(Alpha.class);
      assertEquals("one", alpha.getOne());
      assertEquals("two", alpha.getTwo());
      assertEquals("three", alpha.getThree());
   }
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.