Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Rotate object in absolute axis, not its own

  • Rotate object in absolute axis, not its own

    Posted by Juan Irache on October 8, 2019 at 1:27 pm

    Hi,

    I have been fighting with this seemingly simple problem: I want to rotate an object based on external data. The rotation should always happen in the same axes in relation to the viewer, that is, the x axis should create vertical rotation, y should do horizontal rotation and z should do “clock-like” rotation. The problem is, when you rotate an object, its axes change position, so if you rotate, say Z after having rotated around Y, Z rotation looks like Y rotation. Not sure if I’m explaining this right.

    I thought I could solve this by orbiting a camera around my object, by parenting it to a null object placed in the center that performs the rotation. That way the Z axis is preserved, but X and Y still get mixed up.

    Here’s a short video showing what I mean: https://youtu.be/WRmpviCpPAI

    I think the mathematically correct way to solve this is using quaternions. But 1) I don’t know them well enough 2) It seems overkill to code a very long expression, with classes and things like that, just to solve this.

    I’m probably not the first to face this problem, has anyone got experience with something like it?

    Thanks!

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

    Juan Irache replied 6 years, 6 months ago 4 Members · 7 Replies
  • 7 Replies
  • Juan Irache

    October 8, 2019 at 5:49 pm

    What baffles me the most is why the second rotation in the “orbiting camera” version does not happen around the X axis (red arrow) but around Z (blue):

    https://youtu.be/f5vF-22FiQw

    (this is the front view of the static object, the arrows are on the null object the camera is parented to)

    It looks like when X or Y are rotated, Y or X will not rotate around the arrow any more. What are they rotating around then? This is getting very confusing.

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

  • Michael Szalapski

    October 8, 2019 at 7:36 pm

    If you have a chain of nulls. One for each axis (or maybe two nulls and your regular object) with each one parented to the next, you can get rotation always in the desired axis.

    – The Great Szalam
    (The \’Great\’ stands for \’Not So Great, in fact, Extremely Humble\’)

    No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.

  • Juan Irache

    October 8, 2019 at 8:22 pm

    No, unless I’m doing something very wrong, the rotation of the top null affects the rotation of the middle null, and this one affects my object (it has to, that’s the point). Then the axis directions are different from the inital ones and the object does not rotate around world axes:

    https://youtu.be/0Z-MydkJH8c

    Z and X are reversed at the end of the animation

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

  • Greg Gesch

    October 8, 2019 at 11:10 pm

    Hi Juan. Are you aware that you have Local, World or View axis modes as the three icons above your viewing window?

  • Juan Irache

    October 8, 2019 at 11:15 pm

    Hi Greg,

    Yes, but those modes only affect the three dimensional arrows (red, green, blue) and what happens when you drag them, don’t they? My rotation is based on external data (mgJSON) through expressions.

  • Cassius Marques

    October 9, 2019 at 1:09 pm

    I think what you want to do would require AE to disregard previous evaluated parameters. Which in a temporal manner, it can’t. It can just evaluate the current frame and since rotation is inertly linked, you can only get what you’re getting.

    Cassius Marques
    http://www.zapfilmes.com

  • Juan Irache

    October 9, 2019 at 9:54 pm

    It’s definitely possible with expressions and quaternions. Here it works well in JavaScript: https://editor.p5js.org/jeremy.behreandt/sketches/SMB8TYjkj

    If there’s no other way I’ll try to port that when I find some spare time.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy