Processing Python
I am writing processing with python mode these days.When I run my project as this:
----------------------------------------------------------------------------------------------------
particles = []
def setup():
size(1024,700)
noStroke()
for i in range(1000):
x = random(0,width)
y = random(0,height)
v_mag = random(1.0,2.0)
v_angle = random(-2*PI,2*PI)
particle =
particles.append(particle)
def draw():
fill(0,10)
rect(0,0,width,height)
fill(255)
for particle in particles:
noiseValue = noise(0.001*particle,10+0.001*particle,frameCount*0.005)
particle = map(noiseValue,0,1,-2*PI,2*PI)
vx = particle*cos(particle)
vy = particle*sin(particle)
particle = particle + vx
particle = particle + vy
if particle>width or particle>height:
particle = random(0,width)
particle = random(0,height)
circle(particle,particle,2)
------------------------------------------------------------------------------------------------------
There is only a particle,not a lot.
but I used 'for i in range(1000):',why does it happened?
Friends who have studied processing, please help me!
particles = []
def setup():
size(1024,700)
noStroke()
for i in range(1,1000):
x = random(0,width)
y = random(0,height)
v_mag = random(1.0,2.0)
v_angle = random(-2*PI,2*PI)
particle =
particles.append(particle)
def draw():
fill(0,10)
rect(0,0,width,height)
fill(255)
for particle in particles:
noiseValue = noise(0.001*particle,10+0.001*particle,frameCount*0.005)
particle = map(noiseValue,0,1,-2*PI,2*PI)
vx = particle*cos(particle)
vy = particle*sin(particle)
particle = particle + vx
particle = particle + vy
if particle>width or particle>height:
particle = random(0,width)
particle = random(0,height)
circle(particle,particle,2) 'range' needs two values
Sorry,I am not good at speaking English Please agree to my friend request
If you has any questions,welcome to ask me
页:
[1]