X, Y and Z rotations for layers problem

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
Manu
Posts: 327
Joined: Tue Aug 03, 2004 10:11 pm
Contact:

X, Y and Z rotations for layers problem

Post by Manu »

I've posted about this a while ago, but I wondered if scripting could provide the answer here. I've got a nagging feeling it can't, but asking is free, so here goes.

It's about the fact that you can rotate a layer on all three axis in AS Pro: X, Y and Z. So far, so good. The problem however is that the X and Z axis are local, the Y axis however is global (I guess you must have some experience with 3D in order to understand what I'm talking about).

Is this AS Pro's way of avoiding gimbal locks?

I had a quick glance at the scripts for both the X and Y layer rotation tools. They seem to be identical apart from "x" being "y" of course. Does this mean that this oddball co-ordination system is hard-coded into AS Pro and can't be changed by re-writing the "lm_rotate_layer_y.lua" script?
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

It seems that you are right: hard-coded.

However, you only need two angles to determine a point on a sphere, so why not choose rotation around the X and Z axis? That way you can still move your 3D shapes along arcs.

Image
User avatar
Manu
Posts: 327
Joined: Tue Aug 03, 2004 10:11 pm
Contact:

Post by Manu »

Thanks. I know about workarounds. You can angle the camera to avoid using the Y-rotation (which is what you're saying, isn't it?). But it would have been nice not to have this problem hard-coded in the first place.
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

I thought you were referring to animating a collection of 3D objects with 3D rotations as if it were a 3D character.
User avatar
Manu
Posts: 327
Joined: Tue Aug 03, 2004 10:11 pm
Contact:

Post by Manu »

Ah, I see. I've never used 3D object in AS Pro.

Well, I've been playing around a bit more with it and I noticed there's some sort of hierarchy Z > X > Y where one axis always rotates relative to the previous one.
When a layer is rotated on the Z axis, the X axis acts as a global axis.
When a layer is rotated on the Y axis, the X axis acts as a local axis.

I know rotating objects is about the most difficult calculation to do in 3D. Is that the problem here?
Post Reply