[Closed] ridiculous accuracy issue
hey guys, i’m trying to reset the transform of certain objects by using obj.transform = matrix3 1
should set the transform matrix to: (matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,0])
which is simple enough. problem is that on certain objects it may have some super tiny numbers that are really close to zero but not zero, when they should be zero.
eg: (matrix3 [1,1.74846e-007,-2.38419e-007] [-1.74846e-007,1,1.74846e-007] [2.38419e-007,-1.74845e-007,1] [0,0,0])
i really need these values to be the actual identity matrix, not just really close to it, as it causes problems when exporting to flight studio format.
some objects are in a heirarchy and i thought this might be a problem but even when i unlink everything the same problem exists.
also i have tried resetting the transform controllers and merging into a new scene and still same problem.
any ideas?
EDIT: i’ve attached an example max file with the problem
Floating Point Precision
Bobo explains it well… follow this thread and read all about it…
http://forums.cgsociety.org/showthread.php?f=98&t=690027&page=1&highlight=floating+point+precision
yes i know about the floating point precision issue and i suspected it might be the case but the problem seems to only affect only certain objects.
so i could have 2 objects, 1 with the proper identity matrix and another with the close but not close enough matrix.
even if i say wrongObj.transform = properObj.transform the problem remains
i’ve even tried setting the .rotation property to quat 1 which also fails to yeild a proper result.
the precision issue seems to be related to the use of list controllers (in your file those were created when the objects were freezed in transform).
you have two options:
-setting the first controllers as active (position and rotation) and setting the transform to identity
try
(
$.position.controller.active=1
$.rotation.controller.active=1
)catch()
$.transform=matrix3 1
(i guess the previous method doesn’t work always, in that case you should set each controller in the list to zero)
or
-removing the list controllers and setting the transform to identity:
$.position.controller=position_xyz()
$.rotation.controller=euler_xyz()
$.transform=matrix3 1
Felix you are a life saver. i completely overlooked the posibility of list controllers. i tried setting the transform.controller to a new prs() without looking at the actual controllers, and i see now that doing so still preserves the list controllers.
cheers mate!