cwalrus Posted October 23, 2015 Share Posted October 23, 2015 I promise I'm not being lazy- I've been googling this like mad! Such a simple objective i think... I just want all of my particles to rotate at random rates. I added a POPTorque into the DOPnetwork with this expression i@id; axis.x = rand(@id); axis.y = rand(@id * 10); axis.z = rand(@id * 100); and it works great, but they rotate faster and faster. So i figured it must be because the force keeps adding itself to the particles - so I applied it only to the 'JustBornGroup" but that still seems to apply the same random rotation to all of them. Isn't there a super simple, straightforward way to apply a random rotation speed to each of your particles individually? (or even to each of the instances which I've applied subsequently in SOPS) thanks people! ps file is attached for what it's worth.... LeavesSpin_04.hipnc.zip Quote Link to comment Share on other sites More sharing options...
mestela Posted October 23, 2015 Share Posted October 23, 2015 Use pop spin rather than pop torque. Torque is rotation acceleration, which is why they spin faster and faster, spin is constant. Quote Link to comment Share on other sites More sharing options...
cwalrus Posted October 23, 2015 Author Share Posted October 23, 2015 Thanks - I should have said I tried that too - but it provides the identical rotation to each particle.... How can I randomized it for each particle? Quote Link to comment Share on other sites More sharing options...
pezetko Posted October 23, 2015 Share Posted October 23, 2015 (edited) In POP Spin's vex expression try something like for random speed and random axis: spinspeed = spinspeed*fit01(random(@id),0,10); axis = normalize(vector(random(@id))); Edited October 23, 2015 by pezetko Quote Link to comment Share on other sites More sharing options...
loudsubs Posted October 23, 2015 Share Posted October 23, 2015 A few other ways to handle rotations: 1. If you are sourcing from points, give the source points initial angular velocity @w before they go into the popnet. The sourced particles will inherit the angular vel. They will also need @orient vector 4 attibute, otherwise they'll use @v to orient themselves. 2. Post sim, in a point VOP - use the rotate VOP to modify @orient. Make sure to normalize it. Get a random from @id, fit that, mult it by time, and plug into angle. Also create a random vector to plug into axis. Make sure to subtract 0.5 and normalize, since random will only get you 0-1 range by default. Then convert that matrix to a vector 4, @orient. Quote Link to comment Share on other sites More sharing options...
cwalrus Posted October 23, 2015 Author Share Posted October 23, 2015 Thank you people- The best solution for me has been to put this into VEX on the POPSpin: spinspeed = spinspeed*fit01(random(@id),0,10); axis.x = (rand(@id) *2 ) -1; axis.y = (rand(@id * 10) * 2) - 1; axis.z = (rand(@id * 150) *2 ) -1; with the spin speed set to whatever you like. 1 Quote Link to comment Share on other sites More sharing options...
old school Posted October 27, 2015 Share Posted October 27, 2015 Just for completeness and compactness, you can use set(): axis = set((rand(@id) *2 ) -1, (rand(@id * 10) * 2) - 1, (rand(@id * 150) *2 ) -1); No real difference in performance, more fyi. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.