10-11-2009, 07:32 PM
Well, I did some stuff which may be what you're looking for:
1: change the rotation of the instanced geometry so its x-axis points along the bill (so you get better rotation since the order is xyz)
2: added some control-attributes (rotSpeed for rotation speed multiplier, gravPara and gravPerp for the gravity magnitudes when the normals are parallel and perpendicular respectively to scene up).
3: added the pp-attribute gravityField1_magnitude controling the gravity on a per-particle level.
4: made the rotation speed velocity-dependent (it seemed like something you wanted to do anyway)
5: moved the rotation calculations to runtime after dynamics to better control where in the pipe they happen - so the order of things is 1) what's the rotation now - update gravity magnitude 2) what's the velocity now (which is dependent on the gravity magnitude of course) - update rotation.
6: added the stuff you actually asked for in the creation and runtime before dynamics expressions -
vector $randRotPP_rad = particleShape1.randRotPP;
// convert to radians:
$randRotPP_rad = <<deg_to_rad($randRotPP_rad.x), deg_to_rad($randRotPP_rad.y), deg_to_rad($randRotPP_rad.z)>>;
// rotate the vector <<0,1,0>> about the euler rotations to get the direction of the bill's "normal".
vector $up = <<0,1,0>>;
// rotate about x:
$up = rot ($up, <<1,0,0>>, $randRotPP_rad.x);
// rotate about y:
$up = rot ($up, <<0,1,0>>, $randRotPP_rad.y);
// rotate about z:
$up = rot ($up, <<0,0,1>>, $randRotPP_rad.z);
// project on scene up:
float $parallel = abs(dot ($up, <<0,1,0>>)); // if this is 0 it's perpendicular, if it's 1 it's parallel
// map to proper range
particleShape1.gravityField1_magnitude = $parallel * particleShape1.gravPara + (1.0 - $parallel) * particleShape1.gravPerp;
Hope that does what you want.
Sounds like a job for nCloth. Duncan posted a confetti example (http://area.autodesk.com/blogs/duncan/confetti_and_streamers_with_ncloth) on his blog.
EDIT: I just reread your question and this
In short, what I want to do is make a randomized but somewhat directed simulation
probably means the nCloth will be unsuitable.
10-12-2009, 12:18 AM
Thanks for the replies guys. That isn't exactly what I am looking for Anders, but you definitely have set me off on the right foot. I know what I am going to do now so thanks for that. Lots of good info in that file.
Thanks for forwarding that example David. I was thinking of doing this in cloth but I didn't want the sim to get to heavy. Especially with the mesh motion in the wind. I am going to go the dot product route and just make a multiplier with the absolute value of a normalized dot that scales the effect of a particle moving downwards. I will also add some ncloth sims for forground stuff to make it look extra nice. I'll try to post the scene file here when I'm done!
Thanks for your responses.
I also have another question to throw out there if anyone is reading. I created a rolling ball with ncloth and I want the ball to collect small sheets of ncloth as it rolls over them(to create a giant dynamic rolling ball of paper). I tried turning on the stickiness attribute for the various objects but everything just sticks to the ground plane. I also tried using a negative stickyness attribute for the ground plane and a positive one for the ball and sheets of paper but still couldnt get what I wanted. It would be pretty simple make a small script that just dynamically constrains objects to each vertex of the ball but I'm not sure I want to do that because it will look kind of odd. If anyone has any Ideas please let me know! :)
10-12-2009, 04:40 AM
About the falling bills: You may have better luck using a wind field than a gravity field, since a wind field forces particles to reach a certain velocity, rather than applying a (constant) acceleration to them.
10-12-2009, 04:40 AM
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.