Hi. I want to know how to make particles with tails on the picture? I try to do this. But it not work.
searching on google should help you find what you are looking for. This is just one way of doing it.
int i = 0;
void setup(){
size(500,500);
smooth();
noStroke();
background(255);
}
void draw(){
fill(255,25);
rect(0,0,width,height);
fill(0);
ellipse(width/2 + i,height/2 + i,50,50);
delay(100);
i+=10;
}
take a look at the examples provided in the processing ide there is an example of how to make trails like this one, I just cant remember the name of it. Alternatively you would have to create an array or arraylist of a certain size to store the positions of whatever you are drawing and use the array to draw the shape you want.
1 Like
I agree. Your question is too broad. We donβt know whether they are birds or from a firework or fountain
Thanks bro! I got it.
/**
* Transparency.
*
* Move the pointer left and right across the image to change
* its position. This program overlays one image over another
* by modifying the alpha value of the image with the tint() function.
*/
PImage img;
float offset = 0;
float easing = 0.05;
void setup() {
size(640, 360);
img = loadImage("moonwalk.jpg"); // Load an image into the program
}
void draw() {
if(frameCount%5 == 0)
{
fill(255,25);
rect(0,0,width,height);
}
println(frameRate);
image(img, mouseX, mouseY,50,50); // Display at full opacity
//float dx = (mouseX-img.width/2) - offset;
// offset += dx * easing;
//tint(255, 127); // Display at half opacity
// image(img, offset, 0);
}
I changed some codes and this is the effect I want
3 Likes
So, is this solved now?
Congratulations!