There has to be a way...1000 particles evenly distibuted on a 100x100 plane

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 02 February 2008   #1
There has to be a way...1000 particles evenly distibuted on a 100x100 plane

Ok, maybe im being stupid here, but i have used Pflow for quite a while and have never figured out how to do this:

Say i want 1000 flat planes flying towards the camera from the distance and positioning themselves side by side to form a rectangle. Basically like countless corporate videos where the images fly in and form one big image.

Now i COULD animate them by hand, and thats fine, but i would like to do it with pflow so that i can add wind, find targets etc...to make it more interesting.

But if i build a plane that is 100x100 polygons (1000 square) and tell the Pflow position by object operator to use this and use vertex for positions and make my particle count 1000, the particles are not evenly distributed, some clump 4 on top of each other on one vertex whiel leaving the one near it free.

I have to up the count to the many thousands to get it to cover the plane, which is obviously no good.

So, is there ANY way of getting, say, 1000 particles to distribute evenly on 1000 vertexs of a plane?

There must be, which is why i think im being stupid..

Cheers guys

marc
__________________
www.weliketomakethings.com
 
Old 02 February 2008   #2
Try this

http://www.allanmckay.com/tut/test.swf
 
Old 02 February 2008   #3
btw 100x100 = 10,000
 
Old 02 February 2008   #4
Erbsenzähler
 
Old 02 February 2008   #5
I think Orbaz PFlow Toolbox #1 has a solution for this.
 
Old 02 February 2008   #6
Originally Posted by noouch: btw 100x100 = 10,000



So it is...And the funny thing is that i studied physics at university...Oh well, money well spent eh?

Thanks for the replies, i will take a look now. I looked into Orbaz tools 1 but didnt see something that could be used for this, ill take another look.


Cheers,

Marc
__________________
www.weliketomakethings.com
 
Old 02 February 2008   #7
I also found this that would work (i think its the principle as the Mccay vid). So it can be done by breaking the plane into objects, then using those as particles. Ok, seems bizarre that it cant be done more simply, but this is better than nothing.

Thanks again
__________________
www.weliketomakethings.com
 
Old 02 February 2008   #8
Just did a quick test.
Created a square plane, 200x200 with 100 segments, then Mesh select n select all verts. On the Position Obj op, used the same amount of particles as verts in the square, then Location selected vertices and ticked the Separation box. Used a Facin Shap op with a size 2. It worked just fine. Now if you want the lil squares to move, u may want to use the Lock/bound op from PFlow Tools 1.
__________________
WebSite
CGPortfolio

Photos

Flickr

 
Old 02 February 2008   #9
Originally Posted by thethule: I also found this that would work (i think its the principle as the Mccay vid). So it can be done by breaking the plane into objects, then using those as particles. Ok, seems bizarre that it cant be done more simply, but this is better than nothing.

Thanks again


First, the PositionObject+ operator by Orbaz has the option to emit one particle per vertex without repeating until all vertices have been used. So setting the particle count to the vertex count would cover the whole plane.

Second, it can be scripted in 3 minutes, with or without a base plane. Just create a Birth Script, add two nested FOR loops to define the X and Y coordinates of each particle and add a particle in each iteration:

on ChannelsUsed pCont do (
  	 pCont.useTime = true
  	 pCont.useAge = true
  	 pCont.usePosition = true
  )
  
  on Init pCont do  ()
  
  on Proceed pCont do (
  	local theSpacing = 10 --the distance between particles along X and Y
  	local t1 = pCont.getTimeEnd() as float --the end evaluation time
  	if (t1 == 0) do ( --if on frame 0, create particles!
  		for y = 1 to 100 do ( --hundred rows
  			for x = 1 to 100 do ( --hundred columns
  				pCont.AddParticle() --add a new particles
  				pCont.particleIndex = pCont.NumParticles()  --make the last one current
  				pCont.particleTime = 0 --set the time to 0
  				pCont.particleAge = 0 --set the age to 0
  				pCont.particlePosition = [x, y, 0] * theSpacing  --set the position to X,Y * spacing
  			)--end x loop
  		)--end y loop
  	)--end if
  )--end proceed
  
  on Release pCont do ()
  



So I would not say it is not easily possible...

Also note that if you want randomized particles to FORM a grid later in the animation, the Find Target test has an option to specify the absolute world position of each particle using its Scriped Vector channel. So all you need is a Script Operator to specify where the particles should go and tell the Find Target to make them go there...
__________________
Bobo

Last edited by Bobo : 02 February 2008 at 06:17 PM.
 
Old 02 February 2008   #10
Hi,

The script is great bobo, thanks.
I would like to be able to move each object on the grid one at a time with a slight delay.
So if i have 100 objects i would like object 1 to move first and object 100 to move last.
the rest of my events are in the pflow event modules.

Im pretty sure i could use particle speed but i dont know much scripting so would be greatful if anyone could help.

regards

O
 
Old 02 February 2008   #11
So I would not say it is not easily possible...

Also note that if you want randomized particles to FORM a grid later in the animation, the Find Target test has an option to specify the absolute world position of each particle using its Scriped Vector channel. So all you need is a Script Operator to specify where the particles should go and tell the Find Target to make them go there...


Hi Bobo, how would i go about achieving this.Yount i suppose have a little code snippet for us?

thanks

odin
 
Old 02 February 2008   #12
Originally Posted by odinuk: Hi,

The script is great bobo, thanks.
I would like to be able to move each object on the grid one at a time with a slight delay.
So if i have 100 objects i would like object 1 to move first and object 100 to move last.
the rest of my events are in the pflow event modules.

Im pretty sure i could use particle speed but i dont know much scripting so would be greatful if anyone could help.

regards

O


Notice how the Birth script tells each particle its Age is 0?
You could set the age to a different decrementing value and use an Age Test to send out the particles to an event with a Speed Operator one by one...
__________________
Bobo
 
Old 02 February 2008   #13
Originally Posted by odinuk: Hi Bobo, how would i go about achieving this.Yount i suppose have a little code snippet for us?

thanks

odin


Indeed I have the code ready to go for my next CG Academy DVD on "Scripting PFlow"
Here is how it works, in short:

*Add a Script Operator after the Birth operator.
*Enable the Scripted Vector Channel (pCont.useVector = true)
*Use the same loop as in the previous example to define the X and Y coordinates, but write them into the pCont.particleVector channel instead of .particlePosition of each particle. You should make sure you have as many particles as iterations in the loop, or use an IF test to make sure you are not assigning a vector to a non-existing particle.
*Optionally, you could snapshot the mesh of a geometry object and read its vertex positions to make the particles fly to the vertices instead.

*Add a Find Target test and set its "Point" drop-down list to "By Scripted Vector"

Now the Find Target will read the positions stored in the Scripted Vector channel of each particle and move them there over time.

*Send the particles out of the Find Target to another event where you kill the Speed using a Speed Operator set to 0 or a Stop* operator if you have it installed.
*Optionally, use another Script Operator in that final event to assign the content of the .particleVector channel to the .particlePosition channel for each particle in the event to ensure that they land EXACTLY where requested, because Find Target sends out based on proximity, it never really hits the position exactly.
__________________
Bobo
 
Old 02 February 2008   #14
Fantastic replies guys. Thank you to all, thanks Bobo for your knowledge as well.

No time to try it out at this moment, but i will soon.

Cheers!!

Marc
__________________
www.weliketomakethings.com
 
Old 02 February 2008   #15
I will be buying your DVD's too.

thanks for sharing.

O
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 04:53 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.