you can write your own custominterpolator. write a class that extends
Interpolator with

wakeupOnElapsedFrame
or
wakeupOnElapsedTime

in the processStimulus you can then increment the position, etc. how you
want it. It will be called every x frames/milliseconds depending how you
initialized your wakeup conditions.


Another method would be to write a new class that extends *thread* and do
the increment in the body of the run() method.


is there actually any difference in performance using the Interpolator or a
Thread???

ciao.j


----- Original Message -----
From: Michael P. McCutcheon <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 08, 2001 9:01 AM
Subject: [JAVA3D] How do I move an object without interpolators?


> I am used to programming in VRML.  With it, you would have a
> TimeSensor...you would route the timesensor to a particular object, on
which
> you would have a method that was called after each frame.  In this method
> you would update the position of your objects, then when the method
> completed, VRML did it's rendering, and the time sensor would then do it
all
> over again.
>
> What I'm wondering, if I want to move a simple object around from 0
to -500,
> say in 1 increments, (without using an interpolator, I want to explictly
set
> it my self), how would I do this?  I ran some code like this but it simply
> does not seem to work:
>
> I have this in an event handler of a AWT button:
>
>   for(int counter=0; counter<100; counter++) {
>    z=z-0.2f;
>    translation.set(0,0,z);
>    transform3D.setTranslation(translation);
>    transformGroup.setTransform(transform3D);
>   }
>
> Any tips on what classes I should be looking at to do such a thing the
right
> way?
>
> Thanks for any info...
>
> Mike
>
>
===========================================================================
> 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".

Reply via email to