Jump to content

Particle density emission by speed or distance to object...


Bog

Recommended Posts

Hi!  First question here....

I've got a bunch of particles which are streaming from their emission, to a destination.  I'm controlling them with a POP curve force.

What I need the particles to do is emit density, but I need them to do so either based on speed (faster = more density emission) or on distance (starting a 0, ramping up to full emission as they reach the end of their course).

I'm sure this should be straightforward, but I'm not sure how to convey my wishes to Houdini.  Can anyone throw me a hint?

Edited by Bog
Clarity.
Link to comment
Share on other sites

You can drop down a wrangle before you stamp out your density into the fluidsource.

This will allow you to use a ramp to shape density based upon age.

float index_into_ramp = fit(@age,0,@life,0,1);
f@density = chramp("shape",index_into_ramp);

 

You could also examine velocity and construct something based upon that value as well. Assume particles are falling.

// NOTE: -50 is determinend by looking at the spreadsheet for the fastest value.
float index_into_ramp = fit(v@v.y,0,-50,0,1);
f@density = chramp("shape",index_into_ramp) * 100;
f@pscale = chramp("shape",index_into_ramp);

 

You may want to create a second ramp to control the @pscale attribute for size of life perhaps?

 

For distance to object plug your object into the second input of the wrangle and determine the length of the vector from the current particle to the center point of the object on the second input.

Typically...

float l = length(@P-OpInput1_P);

 

Untitled-1.jpg

ap_desnity_stamp_by_speed.hipnc

Edited by Atom
  • Like 1
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...