Menu

how to reset GLScene back to its original view?

Help
2016-10-22
2016-10-31
  • John Kidikian

    John Kidikian - 2016-10-22

    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

     
  • Massimo Zanoletti

    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

     
    • John Kidikian

      John Kidikian - 2016-10-31

      Thank you Massimo,
      the method "ResetRotations" worked like a charm, and gave me the behaviour I'm looking for.

      Much appreciated
      John

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.