We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › function moveTo
Page Index Toggle Pages: 1
function moveTo (Read 1063 times)
function moveTo
Jan 29th, 2010, 9:05am
 
Hello,

I was trying to play with the processing program from the aharef.info website...i downloaded the htmlparser and traer libraries in respective sketchbook and sketch folder.  Still i cannot run the program.

It says: the function moveTo(float, float, int) does not exist. which  library am i missing?  appreciate any help...

mani
Re: function moveTo
Reply #1 - Jan 29th, 2010, 10:31am
 
moveTo() is used once, from what I can tell:
p.moveTo( q.position().x() +randomX, q.position().y() + randomY, 0 );

The object p is defined here:
Particle p = physics.makeParticle();

Which comes from this:
ParticleSystem physics;

So the problem is with the Traer Physics code.

Looking at:
http://www.cs.princeton.edu/~traer/physics/

We see the following right near the top:
"Changes since the previous version
Methods setVelocity, moveTo and moveBy are gone. Instead use:
position().set( float x, float y, float z )
velocity().set( float x, float y, float z )
position().add( float x, float y, float z )
velocity().add( float x, float y, float z )"

Thus, I suggest you try changing the line:
p.moveTo( q.position().x() +randomX, q.position().y() + randomY, 0 );

To:
p.position().set( q.position().x() +randomX, q.position().y() + randomY, 0 );
Page Index Toggle Pages: 1