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 › Question to Flocking.pde
Page Index Toggle Pages: 1
Question to Flocking.pde (Read 484 times)
Question to Flocking.pde
Nov 12th, 2007, 10:48pm
 

Hello all,

I have a question to flocking.pde.

Does anyone know if it's really 3D or just 2D?

How can I modify the program so that each boid starts
at a certain point A, flies around and lands on a certain 3D-Point B?

Thanks a lot!

Greetings,

Chrisir

Re: Question to Flocking.pde
Reply #1 - Nov 14th, 2007, 7:14am
 
Hi. It is just 2D : it uses Vector3D() to define the location and direction of the boids, but only 2 parameters (x, y) are specified (not z).

To make a boid start at a certain point, see the Boid() constructor :
Quote:
Boid(Vector3D l, float ms, float mf)

'Vector3D l' is it's location at start.

To make a boid flies around and lands on another point, maybe the seek() and arrive() methods could help, but I haven't tried.
Page Index Toggle Pages: 1