Hi,
I have a blog at wordpress.com (not with wordpress.org) which does not allow uploading of files other than image or video (
check here). FTP is also not allowed. I have some information from
this site which was previously discussed in the old forum but nonavailability of the above mentioned features makes it impossible
How does one post Processing's applet or output in wordpress.com for others to view? Is there any other way or any other blogger website that allows one to do so?
I want to share my stuff and enthusiasm with other people but my current status does not justify buying server space/ web page.
Hi all
Few minutes ago I finished my first sketch which is two days after I stumbled upon Processing.org. When I decided to post it in the forum, I realized that it had been shifted to a new location just few hours ago, so my first sketch gets to be in the first dozen or so posts in the forum
How cool is that?!?!? (I know it is a silly consolation but I am thrilled)
I would like to thank the people behind this project. It is a wonderful tool for people at any level. I would be more than happy to help and contribute in any way that I can.
Thanks once again and hope you all enjoy creating wonderful stuff.
Hi all
This is my first step towards a Boid code. I wrote this code to learn PVector, vector manipulation and OOP (Class). This sketch creates a system with two elements (balls) that try to catch up to the mouse pointer. These elements bounce off the walls and have different accelerations. Red ball's acceleration is twice that of the blue ball. Both have a maximum speed limitation. Both balls start at random locations. The user can assign the acceleration and color of the balls while creating the Object. I have placed as many comments as time allowed (it is Friday past midnight).
Next step would be to make these elements interact with each other while chasing the target which would make it a Boid code.
Took help from
PVector and
Objects tutorial here @ processing.org
Have fun with the code and the animation. Feel free to comment.
Bye,
pf
Code
// Declare Objects Boid Boid1; Boid Boid2;
void setup() { size(500,500); background(2); Boid1 = new Boid(new PVector(random(width),random(height)), new PVector(0,0), 1.0, color(255,0,0)); Boid2 = new Boid(new PVector(random(width),random(height)), new PVector(0,0), 0.5, color(0,0,255)); }
void move() { // Determine Mouse location PVector mouse = new PVector(mouseX,mouseY); // Determine which direction to go (accelerate) PVector direction = PVector.sub(mouse,pos); // Determine how close to target float separation = direction.mag(); direction.normalize(); // Normalize to get unit vector direction.mult(acc); // Calculate actual acceleration accelerate = direction;