tallen Posted April 6, 2010 Share Posted April 6, 2010 Pretty sure I have the inverse square of $VY below: 1/($VY^2+1) but I can't seem to be able to get the normalized inverse square of velocity. Any expression help please? thanks! Quote Link to comment Share on other sites More sharing options...
Macha Posted April 6, 2010 Share Posted April 6, 2010 Shouldn't that be a vector in that case? Quote Link to comment Share on other sites More sharing options...
mightcouldb1 Posted April 6, 2010 Share Posted April 6, 2010 (edited) In order to normalize something to a 0-1 range you have to take the max value and use that as the divisor. This thread may be useful to you: You can also use the fit expressions if you type "exhelp fit" in the hscript textport, you will see some examples. You will probably be using fit01 in which case you will need to specify min and max values to be remapped to a 0-1 range. Edited April 6, 2010 by mightcouldb1 Quote Link to comment Share on other sites More sharing options...
Macha Posted April 7, 2010 Share Posted April 7, 2010 (edited) It depends on what you really want. If by "normalization" you mean "fitting into 0-1 range" then you can divide by maximum of that whole expression you wrote (but careful, in another expression you may get negative numbers). Or, use the fit expression. In both cases you may need to find the min and max values either via a network ( with attribute promote) or a small python script. One problem here could be freak values that give you bad results, especially with particles. In that case you may need a clamp as well. If you however you are after the normalized vector, or a component of a normalized vector, then you should do that on an expression having $V and not $VY (and don't divide the vector by a number!) Edited April 7, 2010 by Macha Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted April 7, 2010 Share Posted April 7, 2010 The expression 1/(x2+1) will always have a [0,1] range for every real-valued scalar x, so I think in this case, interpreting "normalization" as the requirement that the result be in the [0,1] range is not the issue (as this will automagically happen by itself). I believe the confusion here comes from trying to apply this quadratic variation on the inverse square law to a directional vector (velocity). That, I'm afraid, doesn't make much sense. Need a better explanation of what the OP is trying to do, I think. Quote Link to comment Share on other sites More sharing options...
tallen Posted April 15, 2010 Author Share Posted April 15, 2010 Absolutely right. And I should explain because I think I just set everyone off on a wild goose chase. My apologies. I have a sim animating straight up and then falling down to the surface. The sim has already been cooked and so I'm only putting some additional pscale onto the particles.... So anyhew, at it's peak height, the particles need to be a bit larger than the rest of the particles so that when I mesh using the "Particle Fluid Surface" sop I get a smooth increase in scale based on taking the inverse square of $VY. (It works just fine as is and I moved on). But that night, at some point I felt it necessary to include $VX and $VZ so that I could possibly prevent any unwanted visual artifacts. I suppose I was thinking of something like using the length expression but somehow translating that to normalize?... What? Wow I can't even imagine at this point. Next time I need to re-visit this perhaps I'll do something like evaluating the length($VX,$VY,$VZ) first and then adding the inverse square... thanks everyone. The expression 1/(x2+1) will always have a [0,1] range for every real-valued scalar x, so I think in this case, interpreting "normalization" as the requirement that the result be in the [0,1] range is not the issue (as this will automagically happen by itself). I believe the confusion here comes from trying to apply this quadratic variation on the inverse square law to a directional vector (velocity). That, I'm afraid, doesn't make much sense. Need a better explanation of what the OP is trying to do, I think. 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.