fxrod Posted March 27, 2014 Share Posted March 27, 2014 Hey All: This is a lay and perhaps naive approach I put together for getting rotations in H13. Attached is a file that has this approach. My physics no es bueno, so I'm wondering if anyone here can tell me if what I'm doing is kosher. It certainly seems to get me what I think I want. Here's an outline of how I went about it. I implore anyone here to tell me if there's a more correct or elegant solution. Randomize the mass of the particles. This affects their speed/acceleration based on the force applied. Calculate speed by getting the length of the velocity. Create a rotation axis based on velocity. I did this by getting the cross product of the normalized velocity and an up vector (0, 1, 0). Set torque.x, torque.y, and torque.z to my rotaxis components. Use speed to scale my torque. Let me have it! I needs to know! Thanks in advance. Attached is the file. rotationPhysics.hipnc Quote Link to comment Share on other sites More sharing options...
fxrod Posted March 27, 2014 Author Share Posted March 27, 2014 This is not a technically correct way of doing it. I'm hijacking torque per frame. Instead, it's probably best to set the orient attribute and use accumulated speed as the angle. I can't take credit for this, but you know who you are that helped. I'll be posting a simple file soon. Quote Link to comment Share on other sites More sharing options...
slamfunk Posted March 27, 2014 Share Posted March 27, 2014 please do!! Quote Link to comment Share on other sites More sharing options...
pclaes Posted March 27, 2014 Share Posted March 27, 2014 Your setup is the way I like doing it as well -- the accumulated speed, that is. I like accumulating my length of my velocity in a 'traveldistance' attribute. This allows for much more post simulation control, as you can vary the amount of rotation per particle without having to re-sim. Also this is useful if you are doing any kind of crowds and remapping animation or anticipating acceleration which can trigger behavior. I don't really like linking my axis of rotation to the velocity, since any kind of bounce can really abruptly change directions. So either I just chose a random axis per particle to rotate around based of the id of the particle ( could even be two axes which are blended over the particles age to make it a bit more interesting), or I actually update my coordinate system in pops (limiting the amount of change of direction my normal/up axes are allowed per frame). Quote Link to comment Share on other sites More sharing options...
fxrod Posted March 27, 2014 Author Share Posted March 27, 2014 (edited) Thanks for the feedback Peter. I included a simple .hip file that has speed based rotation. Though, I do use the velocity and a cross-product with a random axis. This is using a quaternion VOP to bind the orient attribute. rotationPhysics.v2.hip Edited March 27, 2014 by fxrod 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.