Rotation Order

All topics about ZGameEditor goes here.

Moderator: Moderators

User avatar
Kjell
Posts: 1929
Joined: Sat Feb 23, 2008 11:15 pm

Rotation Order

Post by Kjell »

:!:

The internal rotation order of ZGameEditor is ZYX*, while the default in Max / Maya / Softimage is XYZ. If nobody objects, I'd like to see this changed.

In the meantime ( in case you're somehow exporting animations to ZGE ) .. make sure to put your Local Kinematics on ZYX before animating, or stay away from the Transform components and DIY using the OpenGL32 library.

*ZYX means that the glRotatef order is XYZ, while XYZ is the opposite.

K
Attachments
Order.gif
Order.gif (11.18 KiB) Viewed 16671 times
User avatar
VilleK
Site Admin
Posts: 2382
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

This means changing the order of glRotate-calls, mainly in the "ApplyRotation"-routine in Renderer.pas. Right?

This sounds reasonable to me. I'm not sure what kind of effects this may have though. Can you foresee any compatibility problems?
User avatar
Kjell
Posts: 1929
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hmm,

Model and Transform Components that use more then 1 rotation axis* will not give the same results as before ( i wonder how many people used this though ). Apart from the camera .. since both the camera-rotation-order and the internal-rotation-order are reversed, that has always been right :)

*Within the same component, sequential or parented components will behave the same.

K
User avatar
VilleK
Site Admin
Posts: 2382
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Kjell wrote: Apart from the camera .. since both the camera-rotation-order and the internal-rotation-order are reversed, that has always been right
Currently both camera and model rotations use the same ApplyRotation-routine. Do you mean they would need to be split up for it to be correct? So that model use the XYZ-order and camera use ZYX-order?
User avatar
Kjell
Posts: 1929
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hej Ville,

Why not simply use a temporary TZVector3f where you cross-assign the values of CameraRotation to ( X->Z, Y->Y, Z->X ), and then call ApplyRotation using that variable?

K
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

I assume this will break some of my unfinished projects,. :( But no biggy, I can always finnish them with the current version, or rework them to fit the changes.
Since I don't own any of those expensive applications,. (perhaps I should just find a nice torrent?) I would need to build an exporter for Milkshape or Blender and would probably find the same issue.

I would still like to see a basic curve editor in ZGE for doing simple animations (and other control uses) with basic shapes and procedural models ;) I was hoping Sculptris would get a painting release soon as it is free and a super fun modeler,. I see myself doing some stuff using that.

http://www.youtube.com/watch?v=rBI17bswg2M&NR=1
iterationGAMES.com
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et »

SoftImage is free.
"great expectations"
User avatar
Kjell
Posts: 1929
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

:)
Softimage is free
Not exactly .. Softimage Mod Tool is free ( so is Maya PLE and GMax ), but the commercial version is around $3000.

@jph - I still think a COLLADA importer is a better time investment then a Curve Editor. Sure it would be nice to have a internal audio / image / animation editor, but Audacity / GIMP / Blender are perfectly fine for those purposes :wink:

K
User avatar
VilleK
Site Admin
Posts: 2382
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

I just tried to implement this and quickly found a couple of incompatibilities in the sample projects. Both the ShooterModel in ZBlast and the EyeModel in TripleE depends on the current rotation order. Sure it is easy to fix those projects but it still makes me consider if the change is required. You know I don't like to introduce incompatibility and I take pride in making ZGE fully compatible between versions :) . Do you consider the current ZGE-rotation order "wrong" or is it just "reversed"? If the solution to make it work with another tool is as easy as changing the rotation setting in the other tool like you describe then maybe this is enough and no change in ZGE is necessary?
User avatar
Kjell
Posts: 1929
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hmm,

There's no right or wrong with these kinds of things, only default / conventional. And you cannot simply switch the rotation order of a animation, changing the order changes the animation.

K
User avatar
VilleK
Site Admin
Posts: 2382
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Aha, I can see that being a problem when you want to export existing animations. Ok I'll include it in next beta update and we'll see if there are any problems.
User avatar
VilleK
Site Admin
Posts: 2382
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Here is a test. Kjell, can you please try it out so that I know I've implemented it correctly? The latest code is committed to google code.

http://www.zgameeditor.org/files/ZGameE ... n_test.zip
User avatar
Kjell
Posts: 1929
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Huh ..

That's strange. The Model & Transform rotation order is correct now, but the camera order seems to be reversed ( while it does look like you've solved this correctly in the repository ). Are you sure the zip contains a build that has the camera "fix" applied?

K
User avatar
VilleK
Site Admin
Posts: 2382
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

I thought it was, but just to be sure I've rebuilt and uploaded it again. Please try it now.

http://www.zgameeditor.org/files/ZGameE ... n_test.zip
User avatar
Kjell
Posts: 1929
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

:P

There's definitely something strange going on. The Camera rotation order is actually correct when simply previewing App, but as soon as you press Play the order is reversed. Try starting and stopping the attached example ..

K
Attachments
Static.zgeproj
(566 Bytes) Downloaded 650 times
Post Reply