Search - User list
Full Version: Change in Life Expectancy affecting $LIFE
Root » Houdini Indie and Apprentice » Change in Life Expectancy affecting $LIFE
Kelman14
I have an expression on a property node under Uniform Scale: (0.25 + ($LIFE * 50)) and my particles are simulating exactly how I want them too. However, I just changed the Life Expectancy of my particles from 100 to 4. Doing so drastically changed $LIFE thus making my particles scale up uncontrollably. Is there some math that I can do to my Uniform Scale expression to return my particles to the way they were before without having to just tweak the numbers until it looks good again?
tamte
I assume you are talking about old POPs
$LIFE s normalized age from 0-Lifespan range to 0-1
so
$LIFE = $AGE/$LIFESPAN
and because you have changed lifespan (Life Expectancy) from 100 to 4 it will affect the point scale drastically as it delends in $LIFE
to keep your math independent of lifespan it's better to base it on $AGE (which is life in seconds, not normalized to the lifespan)
so for your case you want the value returned by $LIFE to be the same for both cases
your $LIFE value was $AGE/100 so just replace the Uniform Scale expression with that
(0.25 + ($AGE/100 * 50))
which equals ==>

0.25 + $AGE/2

and it should be the same as original no matter how you change the lifespan
old_school
What Tamte said but here's an exact get 'er done conversion:

(0.25 + (($LIFE * 4/100) * 50))


Ratios are easy to remember if you go “final / initial” so final is 4 and initial was 100 giving 4/100 multiplied by your variable.

btw if you are using new POPs in DOPs and have the POP Property DOP, it would be:

pscale = (0.25 + (@nage * 4/100) *50);

@nage is what $LIFE was.

—-

+1 vote for using $AGE in old POPs or @age in POPs in DOPs as it is immune to changes in lifespan.
Kelman14
Much thanks to both of you. Works like a charm
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB