1 particle per polygon?

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 01 January 2009   #1
1 particle per polygon?

Hi guys,

I'm currently playing around with the script operator and birth script, but i'm not much of a scripter. I've gone through some of the threads. Seen the 1 particle per vertex script, just wondering if any one can help me out with 1 particle per polygon, preferable in the middle of each faces. I believe this would be great to be used with the shapemark operator.
Also can the particles placement only be done in the birth script? I've tried to edit the one for the birth script and use in the script operator but there's always error. And one last question in the Allan McKay's obj AB tutorial, there's 2 objects involved in the transition, and the Find Target Operator uses the script vector to directs the particle. How would i go about doing it if i wanted to do a transition between 3 or more objects? I would need the Find Target to use a different script vector at different a time.

Thanks.
 
Old 01 January 2009   #2
-- This is a script that can be used to generate particles
 --
 -- Created:		  6-05-2002
 -- Last Updated:
 --
 -- Author :  Oleg Bayborodin
 -- Version:  3ds max 5.1
 --**************************************************  ******************
 -- MODIFY THIS AT YOUR OWN RISK
  
 on ChannelsUsed pCont do
 (
 	 pCont.useTime = true
 	 pCont.useAge = true
 	 pCont.usePosition = true
 	 pCont.useSpeed = true
 	 pcont.useShape = true
 )
 
 on Init pCont do 
 (
  
 )
 
 on Proceed pCont do 
 (
 	t1 = pCont.getTimeStart() as float
 	t2 = pCont.getTimeEnd() as float
 
 	if (t1 < 0) then (t1 = 0) 
 	
 	if (t2 < 1*160) do -- 100 frames
 	(
 		for i = 1 to ((polyOp.getNumFaces $sphere) ) do
 		(
 			curTime = 8*i as float
 			pCont.AddParticle()
 			pCont.particleIndex = pCont.NumParticles() -- last particle that was added
 			pCont.particleTime = curTime/160
 			pCont.particleAge = 0
 			pCont.particlePosition = (polyOp.getSafeFaceCenter $sphere i)
 			pCont.particleSpeed = [0, 0, 0]
 		)
 	)
 )
 
 on Release pCont do 
 (
  
 )
 


mind that u have to replace $sphere with what ever ur object┤s name is. $YourObject etc.
check attached screenshot

kind regards,
Anselm
Attached Images
File Type: gif particle-per-face-center.gif (81.3 KB, 102 views)
 
Old 01 January 2009   #3
Nice one Anselm
__________________
poof ~>Vimeo<~
 
Old 01 January 2009   #4
thanks, bro!

its all Oleg┤s script though. i just posted what sits in my script directory
 
Old 01 January 2009   #5
Thanks alot Anselm.

Comparing ur script and the one particle per vertex script. Trying to understand it. Had already tried using getFaces to replace the getVerts from the 1particle per vertex script, but it doesn't work.
hahaha..
Just wondering if there's a way to spawn the particle one by one and then with the find target operator go to the faces. I've tried to delete all but 1 particle and then using it to spawn more but the particles always go that 1 face. Is there a way to tell the particle to use the script vector from another PF source?

Thanks.
 
Old 01 January 2009   #6
If you are using Allan's technique:

1. I if you want more than 1 target object. Add additional targets to the initial position object operator. (you asked this earlier)

2. If you want them to appear and find the targets at different times add an event with an age test in between the send out and the next event. If you don't want to see the particles prior to the them leaving the sphere (as used in his example) then just change the display ops to none or delete the display ops all together.

The premise is you are getting the particle location, storing that information, then directing your particles to go to that location when you need them too. So you need that location information before you can do anything.
__________________
poof ~>Vimeo<~
 
Old 01 January 2009   #7
I see, didn't thought of it that way. I Haven't got the time to try it out now, will post again once i get something similar to what i imagined. I really learnt alot from the forum. Thanks alot.
 
Old 01 January 2010   #8
Originally Posted by PsychoSilence:
-- This is a script that can be used to generate particles
  --
  -- Created:		  6-05-2002
  -- Last Updated:
  --
  -- Author :  Oleg Bayborodin
  -- Version:  3ds max 5.1
  --**************************************************  ******************
  -- MODIFY THIS AT YOUR OWN RISK
   
  on ChannelsUsed pCont do
  (
  	 pCont.useTime = true
  	 pCont.useAge = true
  	 pCont.usePosition = true
  	 pCont.useSpeed = true
  	 pcont.useShape = true
  )
  
  on Init pCont do 
  (
   
  )
  
  on Proceed pCont do 
  (
  	t1 = pCont.getTimeStart() as float
  	t2 = pCont.getTimeEnd() as float
  
  	if (t1 < 0) then (t1 = 0) 
  	
  	if (t2 < 1*160) do -- 100 frames
  	(
  		for i = 1 to ((polyOp.getNumFaces $sphere) ) do
  		(
  			curTime = 8*i as float
  			pCont.AddParticle()
  			pCont.particleIndex = pCont.NumParticles() -- last particle that was added
  			pCont.particleTime = curTime/160
  			pCont.particleAge = 0
  			pCont.particlePosition = (polyOp.getSafeFaceCenter $sphere i)
  			pCont.particleSpeed = [0, 0, 0]
  		)
  	)
  )
  
  on Release pCont do 
  (
   
  )
  


mind that u have to replace $sphere with what ever ur object┤s name is. $YourObject etc.
check attached screenshot

kind regards,
Anselm


Thank you very much for the script. But whatever I am doing I can't get it to work.

I've created an object, called it "sphere" tried converting it to a edit mesh, edit poly, selected the... damn... no... I didn't try selecting the polys...

just tried it out and it worked!


thanks!

 
Old 07 July 2010   #9
I did something similar, but am having difficulty setting the particle orientation to the face normal in the birth script. Does anyone know how to do this? I know I can do it with standard pflow operators but i'd much rather have it in the birth script
 
Old 07 July 2010   #10
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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
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 02:55 PM.


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