Results 1 to 7 of 7

Thread: Interpreting rotation animations

  1. #1
    Junior Member
    Join Date
    Feb 2009
    Posts
    4

    Interpreting rotation animations

    Hi,

    I'm having some difficulties finding the proper specs about how animated rotation values are to be interpreted.

    Assuming the following examples (all with linear interpolation):

    example 1:
    - 2 animation keys: 0, 180
    I assume that in this case a counterclockwise rotation of 180 degrees has to be performed, since 180 is a positive value. Is this correct?

    example 2:
    - 2 animation keys: 0, -180
    clockwise rotation of 180 degrees, since -180 is negative

    example 3:
    - 3 animation keys: -360, -180, 270
    key 1 to key 2: clockwise rotation of 180 degrees
    key 2 to key 3: counterclockwise rotation of 90 degrees (since 270 is positive)?

    example 4:
    -3 animation keys: -360, 180, -270
    key 1 to key 2: counter-clockwise rotation of 180 degrees
    key 2 to key 3: clockwise rotation of 90 deg (since -270 is negative)?

    If the above given examples are true, how do I specify a clockwise rotation of 90 degree from key 2 to key 3, in the following case?
    - 3 animation keys: 0, 90, ?

    Are those the proper ways to perform the rotation given those key frames? Can someone even point me to the definition in the specs?

  2. #2
    Member
    Join Date
    Feb 2005
    Location
    San Jose, CA
    Posts
    63

    Re: Interpreting rotation animations

    example 1:
    - 2 animation keys: 0, 180
    The value is increasing, so it is counter clockwise.

    example 2:
    - 2 animation keys: 0, -180
    The value is decreasing, so it is clockwise.

    example 3:
    - 3 animation keys: -360, -180, 270
    key 1 to key 2: increasing, counter clockwise
    key 2 to key 3: increasing, counter clockwise

    example 4:
    -3 animation keys: -360, 180, -270
    key 1 to key 2: increasing, counter clockwise
    key 2 to key 3: decreasing, clockwise

    -3 animation keys: 0, 90, 0
    key 1 to key 2: increasing, counter clockwise for 90 degrees
    key 2 to key 3: decreasing, clockwise for 90 degrees

    The rotation direction of the animation is define by the rate change of interpolated value, not by the actual sign of the value.

    Herbert

  3. #3
    Junior Member
    Join Date
    Feb 2009
    Posts
    4

    Re: Interpreting rotation animations

    Thx for your answer, that helped a lot.

    However it looks now as if I run into a little problem. I've got a demo scene in Max with a cube turning twice 360 degree (clockwise) around the z-axis. Exporting that scene with FCollada 3.05C, I've getting these key frames:
    0 0 -180 -270 -360 -360 -360 -180 -359.555

    If I interpret it the way you explained, I get the following:
    between 0 and -360: clockwise turn around 360 degree, so far so good...
    but now the next interpolation is between -360 and -180 => counter-clockwise turn aroun 180 degree
    however what I see in Max is a >>clockwise<< turn around 180 degree (followed by another clockwise turn around another 180 degree)

    Did I misunderstand something? Is there a known "bug" in the FCollada exporter? Any suggestions to work around this problem?
    When using the FBX-exporter (version 2009.3) the values are correctly exported (-360, -540, -720), but FBX is hardly an alternative for us...

    [Edit]ok, forget it... can't see the forest for all the trees... of course I've to set -360 back to 0 so the next interpolation will be between 0 and -180 once again.

  4. #4
    Junior Member
    Join Date
    Feb 2009
    Posts
    4

    Re: Interpreting rotation animations

    This linear interpolation is really driving me crazy... I tried the following (the animations using the linear rotation controller):
    1. In 3DSMax add a box.
    2. Add a keyframe at frame 0 with a rotation around the Z-axis of 0 degree.
    3. Add a keyframe at frame 10 with a rotation around the Z-axis of 355 degree (clockwise).
    4. Add a keyframe at frame 20 with another rotation around the Z-axis of 355 degree (clockwise).

    Now export that animation using FCollada 3.05C.

    According to the description of uclahklaw I'd expect the following keyframe values for rotZ in the DAE-file:
    0 -355 -710

    however what I do get is this:
    0 5 55

    I'm feeling rather dumb now... Is it really so difficult to understand and correctly interpret this file, or am I just too stupid to get it...

    To me it all appears as if there is either a limitation (i.e. rotations > 180 or < 180 degree between two keyframes aren't supported) or there is a bug in how fcollada exports the key frames...
    Can someone enlighten me maybe with some reference which state how I've to correctly import these keyframe information?

  5. #5
    Senior Member
    Join Date
    Jul 2004
    Location
    Santa Clara
    Posts
    356

    Re: Interpreting rotation animations

    a rotation of 355 clock wise is the same as a rotation of 5 counter clockwise.
    I do not understand the '55' you are getting though

    I can suggest using more keyframes to make sure I get what I need out of linear interpolation, or use more elaborate interpolation than linear.

  6. #6
    Junior Member
    Join Date
    Feb 2009
    Posts
    4

    Re: Interpreting rotation animations

    "a rotation of 355 clock wise is the same as a rotation of 5 counter clockwise."
    Yes, the outcome is the same, but when it comes to interpolation, 5 does not equal -355, since two keyframes:
    0 -355 would result in a clockwise rotation of 355 degrees, while
    0 5 would result in a counterclockwise rotation of 5 degrees. Or am I wrong here?

  7. #7
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: Interpreting rotation animations

    As Remi suggested, I think if you add a few more key frames to establish the angular direction that Max will export something right. It looks like you're getting the strobe effect like is seen with "backward spinning wheels" in 24fps motion pictures.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •