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 & HelpSyntax Questions › Help explaining me some code
Page Index Toggle Pages: 1
Help explaining me some code (Read 278 times)
Help explaining me some code
Dec 15th, 2008, 2:13am
 
Hello everyone!
I would really apreciate if someone could help me understand how this was made: http://www.openprocessing.org/visuals/applets/visual4ef45330aeaf226e23ee10881076b58c/

There are links there to the code, but i dont really understand it. I see there are various files that are created classes in them but i need a little help to understanding what exactly are they doing because i'm am a very beginner user.

Can somebody please help.
Re: Help explaining me some code
Reply #1 - Dec 15th, 2008, 2:23am
 
More speceficly.. what does Vector3D class do.. cause thats the one i really cant understand.
Re: Help explaining me some code
Reply #2 - Dec 15th, 2008, 2:01pm
 
Vector3D is a generic class, a vector in space, with a number of properties (mostly coordinates, and derived properties like length) and methods (in general, maths with other vectors or get properties).
Note that recent versions of Processing introduced PVector which is basically the same thing (with documentation!).

From a quick look, it appears that this sketch uses it only as a Vector2D, ie. on a plane, and apparently only to hold a pair of values (x, y). Somehow, attractor could have been an extension of Vector3D.
Page Index Toggle Pages: 1