java left logo
java middle logo
java right logo
 

Home arrow Other API Tips
 
 
Main Menu
Home
Java Tutorials
Book Reviews
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Java Network
Java Forums
Java Blog




Most Visited Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews
Top Rated Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews


Statistics
Registered Users: 4101
Java SE Tips: 614
Java ME Tips: 202
Java EE Tips: 183
Other API Tips: 779
Java Applications: 298
Java Libraries: 209
Java Games: 16
Book Reviews:
 
 
 
How to use Alpha class E-mail
User Rating: / 8
PoorBest 

An alpha object produces a value, called the alpha value, between 0.0 and 1.0, inclusive. The alpha value changes over time as specified by the parameters of the alpha object.

The alpha object waveform has four phases: increasing alpha, alpha at one, decreasing alpha, and alpha at zero. The collection of all four phases is one cycle of the alpha waveform. These four phases correspond with four parameters of the Alpha object. The duration of the four phases is specified by an integer value expressing the duration in milliseconds of time.

This program illustrates the usage of Alpha through moving the car by different Alpha object.


Image

public BranchGroup createSceneGraph() {
    ...

    // create Alpha that continuously cycles with a period of 1 sec
    Alpha alpha1 = new Alpha();

    alpha1.setIncreasingAlphaDuration(2000);
    alpha1.setAlphaAtOneDuration(1000);
    alpha1.setDecreasingAlphaDuration(2000);
    alpha1.setAlphaAtZeroDuration(1000);

    // create position interpolator
    PositionInterpolator posInt1 = new PositionInterpolator(alpha1,
        objMove1);
    posInt1.setSchedulingBounds(new BoundingSphere());

    posInt1.setStartPosition(-1.0f);

    objRoot.addChild(objPos1);
    objPos1.addChild(objMove1);
    objMove1.addChild(createCar(0.4f0.4f));
    objRoot.addChild(posInt1);

    ...
    
    Alpha alpha2 = new Alpha();

    alpha2.setIncreasingAlphaDuration(2000);
    alpha2.setAlphaAtOneDuration(1000);
    alpha2.setIncreasingAlphaRampDuration(500);

    ...

    Alpha alpha3 = new Alpha();

    alpha3.setIncreasingAlphaDuration(2000);
    alpha3.setAlphaAtOneDuration(1000);
    alpha3.setIncreasingAlphaRampDuration(1000);

    ...
  }

 Related Tips

 
< Prev   Next >

Page 1 of 0 ( 0 comments )

You can share your information about this topic using the form below!

Please do not post your questions with this form! Thanks.


Name (required)


E-Mail (required)

Your email will not be displayed on the site - only to our administrator
Homepage(optional)



Comment Enable HTML code : Yes No



 
       
         
     
 
 
 
   
 
 
java bottom left
java bottom middle
java bottom right
RSS 0.91 FeedRSS 1.0 FeedRSS 2.0 FeedATOM FeedOPML Feed

Home - About Us - Privacy Policy
Copyright 2005 - 2008 www.java-tips.org
Java is a trademark of Sun Microsystems, Inc.