Hi Joel,

   The stopTime of Alpha is equal to:

  stopTime = triggerTime + phaseDelayDuration +
             loopCount*  (increasingAlphaDuration+
                          alphaAtOneDuration+
                          decreasingAlphaDuration+
                          alphaAtZeroDuration);

When alpha is initialize as
  Alpha a = new Alpha(1, 2000);
the increasingAlphaDuration is set to 2 sec
the decreasingAlphaDuration is set to 0 sec
stop time is therefore 2 sec.

After
  a.setDecreasingAlphaDuration(1500);
  a.setMode(Alpha.DECREASING_ENABLE);
  a.setStartTime(System.currentTimeMillis());

the decreasingAlphaDuration is 1.5 sec
the above functions did not change increasingAlphaDuration
which remains 2 sec. (The spec. did not mention
that this will reset increasingAlphaDuration to 0)
Thus stop time according to the formula is 3.5 sec
which is correct behavior.

That's why if we later set
a.setIncreasingAlphaDuration(0);
the stop time becomes 1.5 sec.

Thanks.

- Kelvin
-----------
Java 3D Team
Sun Microsystems Inc.


>MIME-Version: 1.0
>Date: Tue, 6 Feb 2001 14:37:13 -0500
>From: "J. Lee Dixon" <[EMAIL PROTECTED]>
>Subject: [JAVA3D] Alpha: Setting mode does not disable use of
increasingAlphaDurati on
>Comments: To: "Java3DBugReporting (E-mail)" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>
>JDK 1.3, Java3D v1.2.1Beta1
>
>In my code, I use the same Alpha for doing a simple 2 second up-ramp (0
>to 1)...
>        Alpha a = new Alpha(1, 2000);
>This works fine.
>
>... then later use the same object to do a simple 1.5sec down ramp (1 to
>0)
>        a.setDecreasingAlphaDuration(1500);
>        a.setMode(Alpha.DECREASING_ENABLE);
>        a.setStartTime(System.currentTimeMillis());
>
>This should disable the "increasing" parameters, but it doesn't.  The
>alpha lasts for 3.5 seconds, going from 1 to 0 every 1.5 seconds and
>jumping to 0 after 3.5 seconds.  I've included a snapshot of a graph
>showing the trend, and the code used to generate the bug data.
>
>    WORKAROUND:
>        a.setIncreasingAlphaDuration(0);
>
> <<graph.jpg>>  <<AlphaTest.java>>
>
>J. Lee Dixon
>SAIC - Celebration, FL
>407-566-1438
>[EMAIL PROTECTED]    AOL: LeeOrlando
>

===========================================================================
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".

Reply via email to