-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParticle2.pde
More file actions
45 lines (30 loc) · 769 Bytes
/
Particle2.pde
File metadata and controls
45 lines (30 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
class Particle2{ //declare class
float radius;
float x;
float y;
float z;
float howMany;
Particle2(float howHigh, float howWide){
y = howHigh;
radius = howWide;
howMany = int(radius/2*density2*PI); //relation to total circumference
}
void drawParticle2(float speedChange, float offset){ //imports the speed value
rotateY(radians(((speedActual2+speedChange)/radius*frameCount)));
for(int i = 0; i < howMany; i++){
angle2 = radians(i*(360/howMany));
x = cos(angle2) * radius;
z = sin(angle2) * radius;
if (spheres2){
pushMatrix();
translate(x + offset, y, z);
sphere(partSize2);
popMatrix();
}
else {
point(x + offset, y, z);
}
}
angle2 = 0;
}
}