StartTime is initialized to the system time at the time Java 3D starts
up. If you want a behavior to start up at some point in the future,
the easiest way is to either change the start time:
alpha.setStartTime(System.currentTimeMillis()+1000);
or use the trigger time (although we just discovered a bug in setting
the trigger time--unless you set the start time or phase delay *after*
the trigger time it won't work):
alpha.setTriggerTime(1000)
alpha.setStartTime(System.currentTimeMillis());
either way, you need to set the Alpha's loopCount after setting the new
start and/or trigger time. For example, to run the Alpha once:
alpha.setLoopCount(1);
Btw, using the trigger time is more convenient if you have multiple
behaviors that you want to start at different points after the current
time:
currentTime = System.currentTimeMillis();
alpha1.setTriggerTime(2000);
alpha1.setStartTime(currentTime);
alpha1.setLoopCount(1);
alpha2.setTriggerTime(1500);
alpha2.setStartTime(currentTime);
alpha2.setLoopCount(1);
...
Hope this helps.
--
Kevin Rushforth
Java 3D Team
Sun Microsystems
[EMAIL PROTECTED]
>Date: Thu, 16 Sep 1999 09:21:51 -0400
>From: "Benedict, Jon K." <[EMAIL PROTECTED]>
>Subject: Re: [JAVA3D] starting alpha at current time
>To: [EMAIL PROTECTED]
>
>If I understand it, and it seems to work this way,
>starttime of zero, IS the current time, so if you want to start
>one second later, make starttime 1000. Not like VRML,
>where start time is in the year 1970 and you have to use
>two timers to get it to start at current time.
>
>> -----Original Message-----
>> From: oliver radfelder [SMTP:[EMAIL PROTECTED]]
>> Sent: Thursday, September 16, 1999 5:06 AM
>> To: [EMAIL PROTECTED]
>> Subject: [JAVA3D] starting alpha at current time
>>
>> Hi,
>>
>> I am new to java3d, but I am familiar with vrml. Thus I dare to ask the
>> following
>> question.
>>
>> My alpha works fine, when it is created like:
>>
>> Alpha alpha=new Alpha(-1,4000);
>>
>> But I can't figure out how to start it once at a particular point in
>> time:
>>
>>
>> Alpha alpha=new Alpha(1,4000);
>> RotPosPathInterpolator rotPosPath=new RotPosPathInterpolator(alpha,
>> ...);
>>
>> // adjust to System Time
>> alpha.setStartTime(0);
>> // start it one second in the future
>> alpha.setTriggerTime(System.currentTimeMillis()+1000);
>> ....
>>
>> Unfortunately, that does not work. Setting startTime to
>> currentTimeMillis + x doesn't
>> work, either.
>>
>> It seems that I am not the only one with an alpha-problem. The tutorial,
>> which is
>> very good, has only examples, which run indefinitly (-1). Maybe there is
>> one
>> who can give us a working example?
>>
>> Bye, Oliver
>>
>> ==========================================================================
>> =
>> 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".
>
>===========================================================================
>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".
>
===========================================================================
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".