Hello All,
I have a scene where the GLDummyCube has its "PitchAngle", "RollAngle", and "TurnAngle" change.
It also has a GLCamera whose "Position", "SceneScale", and "AdjustDistanceToTarget" are changed.
I'd like to know how to reset the GLScene back to its original position?
Reapplying the original values from design-time doesn't seem to work.
I might be missing something or doing something incorrectly.
thanks in advance
john
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is not a GLScene issue, but a "real world" behavior when you apply multiple rotations on different axes to an object.
Differently from translations, rotations are not "commutative".
This means that if you rotate on X axes of 30° and then on Y axes of 50°, when you want to go back to original rotation you must apply first a rotation of -50° on Y and then -30° on X
If you apply -30° on X anf then -50° on Y you obtain a different position of object.
This also means that if you reset to "zero" X,Y,Z rotation values, you will obtain a wrong position, because of "not commutative" behavior of rotations.
To solve your issue you have 2 ways:
-apply a reverse rotation history (but most often is not applliable)
-use the method ResetRotations of the object. This method does exactly what you want ;-)
Best
Massimo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello All,
I have a scene where the GLDummyCube has its "PitchAngle", "RollAngle", and "TurnAngle" change.
It also has a GLCamera whose "Position", "SceneScale", and "AdjustDistanceToTarget" are changed.
I'd like to know how to reset the GLScene back to its original position?
Reapplying the original values from design-time doesn't seem to work.
I might be missing something or doing something incorrectly.
thanks in advance
john
This is not a GLScene issue, but a "real world" behavior when you apply multiple rotations on different axes to an object.
Differently from translations, rotations are not "commutative".
This means that if you rotate on X axes of 30° and then on Y axes of 50°, when you want to go back to original rotation you must apply first a rotation of -50° on Y and then -30° on X
If you apply -30° on X anf then -50° on Y you obtain a different position of object.
This also means that if you reset to "zero" X,Y,Z rotation values, you will obtain a wrong position, because of "not commutative" behavior of rotations.
To solve your issue you have 2 ways:
-apply a reverse rotation history (but most often is not applliable)
-use the method ResetRotations of the object. This method does exactly what you want ;-)
Best
Massimo
Thank you Massimo,
the method "ResetRotations" worked like a charm, and gave me the behaviour I'm looking for.
Much appreciated
John