Notifications
Clear all

[Closed] changing position of particles in new event

In a particle system I’m working on I’m trying to create particles on the mesh of the particles (with an age test). I was wondering if this is possible.

As I was unable to think of any way to accomplish this I’ve been able with the help of a colleague to create a bounding sphere on which the new particles are created with the following code.


on ChannelsUsed pCont do
(
	 pCont.useTime = true
	 pCont.usePosition = true
	 pCont.useOrientation = true
	 pCont.useEventTime = true
	pCont.useScale = true
)

on Init pCont do 
(
 
)

on Proceed pCont do 
(
	count = pCont.NumParticles()

	for i in 1 to count do
	(
		pCont.particleIndex = i
		oldpos = pCont.particlePosition
		pos = random [-1,-1,-1] [1,1,1]
		pos = normalize pos
		pos *= 10

		if pCont.particleEventtime == 0 do
		(
			pCont.particlePosition = oldpos + pos
		)

	)
)

on Release pCont do 
(
 
)