[Closed] PickPoint() Help Please
Hi all
I am using the pickpoint function and am getting strange results when using it in the front or left viewports.
[-164.272,-2.7043e-006,61.8673]
what is the e-006 number on the Y axis.
regards
Nebille
This is a number that is very very close to 0.0.
-2.7043 * 10^-006 = -0.0000027043
Usually caused by a round-off error.
Thanks bobo that explains the problem , have you any suggestions how i can force the number to round up or down correctly without giving an error?
Max (MAXScript) can handle that number without problems.
You can type in the Listener of your script
-1011e-6
and the result will be
-0.001011
Of course, you could compare the components of the result to a threshold and make them 0.0 if the value is lower.
For example
fn roundOffPoint3 theValue theThresh =
(
if abs theValue.x < theThresh do theValue.x = 0
if abs theValue.y < theThresh do theValue.y = 0
if abs theValue.z < theThresh do theValue.z = 0
theValue
)
roundOffPoint3 [-164.272,-2.7043e-006,61.8673] 0.00001
--Result:
[-164.272,0,61.8673]
Also, Larry’s Avguard DLX extension has a functionc alled CloseEnough that can be used to do such comparisons.
You are sooooooooooooooooooooooooo the man. Thanks for all your help
regards
Nebille