Jump to content

how to rotate particles in houdini 13 (dops)


zhyravetsky

Recommended Posts

  • 2 months later...

I’m learning to use vex in the Pop Torque based on expressions I use in the Rotate POP.

 

-In the angle parameter, I put the following expression: if (  $NUMHIT == 0,    fit01(rand($ID),$T * 40, $T * 720),     fit01(rand($ID), $T * 1000,$T * -120))

-In the axis parameters of Rotate POP, I would put $VX and $VZ of the particles in each respective value.

 

I’d like to know if this is the proper vex form for the above. I've been having trouble finding the vex variable for particle velocity so I guessed:

 

amount = amount;

if (i@hitnum == 0);{                                                                                             

    amount = fit01(rand(@id),@Time * 40, @Time * 720);

}else{

    amount = fit01(rand(@id),@Time * 1000, @Time * -120);   

}

axisx = v@vel.x;

axisz = v@vel.z;

Edited by venator11387
  • Like 2
Link to comment
Share on other sites

Here is the code now and I keep getting an error, which is attached below. Bit of a noob at what's going on.

 

amount = amount;
if (@hitnum == 0) {
    amount = fit01(rand(i@id),@Time * 40, @Time * 720);
}
if (@hitnum == 0) {
    amount = fit01(rand(i@id),@Time * 1000, @Time * -120);    
}
@axisx = v@v.x;
@axisz = v@v.z;

post-9028-0-82040800-1390455008_thumb.jp

Link to comment
Share on other sites

Thank you, one more simple thing. I'm trying to stop the amount based on velocity, but it doesn't work because of this syntax prompt for the bolded. I've tried various ways based on the "Using VEX expressions" guide with no luck.

 

Implicit cast from vector to float. Use explicit cast instead. 

 

if (@v <= .3){
    amount = 0;  
}
Edited by venator11387
Link to comment
Share on other sites

I'm not sure you understand what POP Torque  does

it's not setting rotation of the particles, but spinning force

so setting amount on POP Torque to 0 will not set particles rotation to 0 not even make it to stop, it will simply not introduce any more spinning force on that particle

that means that the particle will still remain spinning at constant speed unless there is something else affecting it (like POP Drag Spin or any custom nodes)

 

so if you want the particle to stop spinning when the speed is below threshold just

remove that if condition from POP Torque

and add POP Wrangle node with following:

if (length(@v) <= .1){
    v@w = 0;    
}

w is angular/spinning velocity so if you set it to 0, no more spinning will occur and particle will stay at it's current rotation

 

if you want however reset it's rotation enter the following instead:

if (length(@v) <= .1 || @age<=@TimeInc) {
    p@orient = {0,0,0,1};    
}
Link to comment
Share on other sites

since POPs are about simulation, it makes sense to affect rotation by introducing rotational force (torque

 

but for explicitly setting rotation I would use POP VOP or POP Wrangle to manipulate orient attribute directly (as showed above), you can even build "POP Rotate" or "POP Orient" very easily with them so that it does exactly what you need 

 

you can have a look at POP Lookat, it modifies orient and torque inside, it may give you some inspiration

Link to comment
Share on other sites

  • 4 months later...

It was a little funny there is a pop drag spin, but not a pop spin .. so I made one. It puts spin on particles, just use a birth group to put spin on the first born frame. There are features for randomization :ph34r:. It can be followed by a pop drag spin.

popspin_v01.otl

Edited by andrewlowell
  • Like 2
Link to comment
Share on other sites

  • 4 months later...

It was a little funny there is a pop drag spin, but not a pop spin .. so I made one. It puts spin on particles, just use a birth group to put spin on the first born frame. There are features for randomization :ph34r:. It can be followed by a pop drag spin.

 

 Strange with that pop drag spin without the spin.  Thanks Andrew :D 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...