PercentStep
double PercentStep (double value, double start, double end )
Return Value:
Arguments:
value |
value to test |
start |
start of interval |
end |
end of interval |
This is the inverse of PercentRange( ). Instead of this function returning the parametric position of value within the interval [start, end], this function takes a parametric position as value and returns the value in the interval corresponding to this parametric position.
As an example we'll go back to what we started in PercentRange( ). We were able to find out how far through the desired range or rotation we were, but now we need to to drive the scale of our bicep bone. Suppose that we want the scale of the bicep to be 1.0 while the rotation of the forearm is 45 degrees or less, but then scale up to 3.0 as the forearm's rotation approaches 60 degrees. We can use the parametric position obtained from Bulge_Range_Clamped from out last example as the value argument for this function:
Bulge_Value
Now the BicepBone will scale from 1.0 to 3.0 as Forearm rotates from 45 to 60 degrees.
Converted from CHM to HTML with chm2web Pro 2.82 (unicode) |