Hello,
I have a particle system that has around 2000 particles in it. I am trying to find the particles in the system that have the minimum velocity of X,Y, and Z and return those minimum velocity values.
Is this possible to find?
-jon
finding minimum velocity of a particle system
8344 7 2- vrljc
- Member
- 63 posts
- Joined: July 2005
- Offline
- pbowmar
- Member
- 7024 posts
- Joined: July 2005
- Offline
- vrljc
- Member
- 63 posts
- Joined: July 2005
- Offline
- pbowmar
- Member
- 7024 posts
- Joined: July 2005
- Offline
There are several ways to do it. Personally, I'd use VEX, and accumulate an attribute that holds the ID of the slowest particle. Then at the end you'd know which one is slowest.
Alternatively, you can read in the whole particle sim into CHOPs (Geometry CHOP using the “v” attribute) and you could see it visually.
What's the ultimate use? When you say “return” where does the min value get used? If you're worried about slow particle, just use a Speedlimit POP )
Alternatively, you can read in the whole particle sim into CHOPs (Geometry CHOP using the “v” attribute) and you could see it visually.
What's the ultimate use? When you say “return” where does the min value get used? If you're worried about slow particle, just use a Speedlimit POP )
- vrljc
- Member
- 63 posts
- Joined: July 2005
- Offline
I am rendering out a velocity pass for motion blur in post. Here is how I am doing it (let me know if there is an easier way to do this, please!):
The particles are copied to metaballs, then using the point SOP i change the color of the metaballs to the velocity of the particles, thus visually representing the particles' color as its velocity. However, if the velocity is negative (my particle system contains particles with both postitive and negative velocity values) then the metaball will render out as black, which is not good.
But once I find the minimum velocity value, which will be negative, then I add the positive of this value to itself to equal 0, then divide by itself times 2, which will change all of those velocity colors to values between 0 and 1. (For example if the minimum velocity for x was -3, then entered into the function would be similar to ((-3+3)/6) .) This is all done in the attributecreate sop.
Then useing a vex_constant with its color overridden by the attributecreate, the resulting render will be that of flat colored metaballs representing velocity. I do have to thank my friend Matthew Parrott for helping me get this far.
But again, if there is an easier way, lemme know!
I think I will try the CHOPs, method, as I will be able to see it very quickly and I only need it once.
-jon
The particles are copied to metaballs, then using the point SOP i change the color of the metaballs to the velocity of the particles, thus visually representing the particles' color as its velocity. However, if the velocity is negative (my particle system contains particles with both postitive and negative velocity values) then the metaball will render out as black, which is not good.
But once I find the minimum velocity value, which will be negative, then I add the positive of this value to itself to equal 0, then divide by itself times 2, which will change all of those velocity colors to values between 0 and 1. (For example if the minimum velocity for x was -3, then entered into the function would be similar to ((-3+3)/6) .) This is all done in the attributecreate sop.
Then useing a vex_constant with its color overridden by the attributecreate, the resulting render will be that of flat colored metaballs representing velocity. I do have to thank my friend Matthew Parrott for helping me get this far.
But again, if there is an easier way, lemme know!
I think I will try the CHOPs, method, as I will be able to see it very quickly and I only need it once.
-jon
- TheDunadan
- Member
- 11 posts
- Joined: July 2005
- Offline
- vrljc
- Member
- 63 posts
- Joined: July 2005
- Offline
- edward
- Member
- 7694 posts
- Joined: July 2005
- Offline
-
- Quick Links