Fergus,
It is most likely cause by gc kick in, due to the newing of
Transform3D, Vector3f and Quat4f objects in the while loop. Try creating
a copy of each outside the while loop, and reusing them in the loop.
Hope this will solve the jerkiness.
- Chien Yang
Java 3D Team.
> Delivered-To: [EMAIL PROTECTED]
> X-Sender: fergusm@pop3
> Mime-Version: 1.0
> Date: Wed, 25 Jul 2001 11:06:40 +0100
> From: Fergus Murray <[EMAIL PROTECTED]>
> Subject: [JAVA3D] Jerkiness
> To: [EMAIL PROTECTED]
>
> I've been experimenting with animating a swarm of T's based on a trig
> function, and most of the time it looks okay but sometimes the trailing T
> jerks horribly, and sometimes the whole lot do. Is this likely to be just
> because I'm not using behaviours to control the animation, or might
> something else entirely be going on? I've attached the source code, which
> is pretty simple, in case anyone wants to look at it. The animation is
> just being done in a run() method, as follows:
>
> public void run(){
> float phase=0;
> while (animThread != null){
> int index = 0;
> int ltLength=leftTeamTransform.size();
> int rtLength=rightTeamTransform.size();
> while (index<ltLength){
> Transform3D thisTransform3D=new Transform3D();
> thisTransform3D.setTranslation(new
> Vector3f(2f+2*(float)Math.sin(phase+(double)index/2),2*(float)Math.cos(phase
> +(double)index/2)-1f,-8f));
> thisTransform3D.setRotation(new
> Quat4f(-5f,(float)Math.sin((double)index/4+phase/2)*10,-2.3f,1f));
> TransformGroup
> thisTransfromGroup=(TransformGroup)leftTeamTransform.elementAt(index);
> thisTransfromGroup.setTransform(thisTransform3D);
> index++;
> }
> phase+=0.05;
> try {
> animThread.sleep(20);
> } catch (InterruptedException e){ }
> }
>
>
> Cheers
>
> - Fergus.
>
> http://fergusmurray.members.beeb.net/
> See irons dance! Wonder at the mysteries of the animated curlicue fractal!
> And so on.
>
> ===========================================================================
> 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".