how to save and restore actors orientation in vtk.js

is it possible to save the actors orientation information somewhere and later reset it after a previous rotation? rotateX,rotateY, rotateZ and rotateWXYZ calls will/may accumulate numeric differences overtime, I would need to avoid these. I couldn’t find a way to do save and restore the actor’s state. please help, thanks!


I don’t think VTK’s matrix math is designed with accurate iterative numerical methods in mind. Those methods are likely designed for a few (thousands at most) iterations. Now, if you have an application like a game, simulation or animation program, a naïve iterative computation of rotations will always suffer from floating point arithmethic errors building up with time. This is especially true for high-FPS animations. Here, this is a practical approach to such problem: In-depth: Matrices, rotation, scale and drifting . I hope this helps.



I think you can set the userMatrix directly.

Thanks Paulo and Sebastien. I think using userMatrix works for the purpose.