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   #16
Hi Boris, i ma trying this but the operator just sends the particles to a single vector.
is there something obvious i am doing wrong?
i can't reduce the number of particles fyling into the end position either, what would be a good way of only have say 50 of 100 particles form a grid at the end of the animation?

arrrrrrrrgh.



 -- This is a script that can be used to generate particles
 on ChannelsUsed pCont do (
 	   pCont.useTime = true
 	   pCont.useAge = true
 	   pCont.usePosition = true
 	 pCont.useVector = true
   )
   
   on Init pCont do  ()
   
   on Proceed pCont do (
 	  local xspace = 16 	
 	local yspace =-16 
 	
 	  local theSpacing = 16 --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 4 do ( 
 			  for x = 1 to 10 do ( 
 			local xspacer = (xspace*x)			
 			local yspacer = (yspace*y) 
 
 			
 				  --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 = [xspacer-200,yspacer+60,0] --set the position to X,Y * spacing
 				  pCont.particleVector = [xspacer-200,yspacer+60,0] 
 				
 				
 			  )--end x loop
 		  )--end y loop
   --	)--end if
   )--end proceed
   
   on Release pCont do ()
 


thanks again all

O

Last edited by odinuk : 02 February 2008 at 01:11 PM.
 
Old 02 February 2008   #17
Works for me - I actually removed your remarks and used the code in a Birth Script to use it to both place the particles on a grid AND define where they should go.
Then I added a Find Target, switched Point drop-down list to "By Script Vector" and the particles flew to the points I defined (which I made slightly different than the starting grid):

 -- This is a script that can be used to generate particles
   on ChannelsUsed pCont do (
  		pCont.useTime = true
  		pCont.useAge = true
  		pCont.usePosition = true
  	  pCont.useVector = true
     )
     
     on Init pCont do  ()
     
     on Proceed pCont do (
  	   local xspace = 16 	
  	 local yspace =-16 
  	 
  	   local theSpacing = 16 --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 4 do ( 
  			   for x = 1 to 10 do ( 
  			 local xspacer = (xspace*x)			
  			 local yspacer = (yspace*y) 
   
  			 
  				   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 = [xspacer-200,yspacer+60,0] --set the position to X,Y * spacing
  				   pCont.particleVector = [xspacer+100,yspacer+200,1000] -- set the target positions
  				 
  				 
  			   )--end x loop
  		   )--end y loop
  	   )--end if
     )--end proceed
     
     on Release pCont do ()


With default settings, it took them 110 frames to reach the destination.
I wired the Find Target to an event containing a Speed operator with 0.0 value and they stopped once there.


If you want only some particles to go to the new grid, just set the particleVector value of a portion of the particles to the same value as particlePosition so they will assume they have already arrived. Or split the particles using Split Amount first, then use the Find Target in the following event, so only a portion would perform the search. Not sure what your problem is...
__________________
Bobo

Last edited by Bobo : 02 February 2008 at 04:30 PM.
 
Old 02 February 2008   #18
It is sinking in slowly, no problem apart from me being a moron!!!

its working for me too


Thanks so much

O
 
Old 02 February 2008   #19
Originally Posted by Bobo: Indeed I have the code ready to go for my next CG Academy DVD on "Scripting PFlow"


Excellent news! Looking forward to it Bobo
__________________
poof ~>Vimeo<~
 
Old 02 February 2008   #20
Originally Posted by Bobo: Indeed I have the code ready to go for my next CG Academy DVD on "Scripting PFlow"


Cant wait for it t release....Any info on its release date Bobo?
__________________
Hardwork is an excellent paymaster......
 
Old 03 March 2008   #21
Sorry for not posting any more replies to my original post. Thank you all for the answers, i just got too busy to look into it for now, but i will do soon.


Cheers,

Marc
__________________
www.weliketomakethings.com
 
Old 03 March 2008   #22
Just a quick question and apoplogies if im being stupid. But...


-Where can i get position+ by orbaz? I cant seem to find it anywhere on their site. Either in their box tools or freebies...

Cheers,

Marc
__________________
www.weliketomakethings.com

Last edited by thethule : 03 March 2008 at 06:46 PM.
 
Old 03 March 2008   #23
Originally Posted by thethule: Just a quick question and apoplogies if im being stupid. But...


-Where can i get position+ by orbaz? I cant seem to find it anywhere on their site. Either in their box tools or freebies...

Cheers,

Marc


I can see it, but only up to Max 8. (This includes maxplugins.de and orbaz.com).
There seems to be no build for Max 9 and 2008, but I might be blind, too...
__________________
Bobo
 
Old 03 March 2008   #24
Yeah, thought of that, but i cant even see it in my max8....i DO remember it in though..weird

Thanks
__________________
www.weliketomakethings.com

Last edited by thethule : 03 March 2008 at 10:09 PM.
 
Old 03 March 2008   #25
posted in wrong forum, please delete.
 
Old 03 March 2008   #26
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
 
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 10:52 PM.


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