Up axis

Hi all,

I’'ve generated a xml file with the collada exporter for 3DS Max in order to load it with the collada dom and render it with directx. I remark than when the user check the box “Y Up”, the geometries position are affected by the change but not the translate and rotate elements in the node element.

Is it normal?

Thanks,

Aurelien

The transform elements are in local coordinates so they don’t really know which way is up or right.

All the geometric values in the asset (document) are with respect to the up-axis orientation. The local transforms apply within that frame of reference also. The up axis value is not a transform of the data, it is an indication of what coordinate system the data is already expressed in.

I’m not sure that answers your question. Can you give an example of what you are comparing?

Hi, tanks for you response,

In a visual scene node whith the UP_AXIS to Y, I have:


<translate>10 20 30</translate>

When I change the up axis to Z I have still:


<translate>10 20 30</translate>

You will agree that we can’t make the translation without testing the up axis:


if(upAxis == UPAXISTYPE_Z_UP)
{
    // translation de (values[0], values[1], values[2])
}
else if(upAxis == UPAXISTYPE_Y_UP)
{
    // translation de (values[0], values[2], values[1])
}
else if(upAxis == UPAXISTYPE_X_UP)
{
    // translation de (values[1], values[2], values[0])
}

I already build my geoms and the coords are already transformed for the right axis and we don’t need to test the up axis to build the geoms correctly.

So juste ask if it was normal these differences.

Thanks

Aurelien

Again the translate is in local coordinates. By changing the coordinate system from Y to Z up, you have not affected the translate. You have reoriented your model however.

Yes, but that transformation depends on the coordinate system of your application. If the model is not authored in the same coordinate system as your app then you have the information to transform the geometric data to match your app. The transforms can be simple swaps as you suggest because of the restricted possible orientations supported by COLLADA (for this reason).

I hope that helps.

The “Y up” option of the Max exporter is not specified by COLLADA. In other words, there are no ‘ccorect’ behavior as defined by COLLADA.

It seems that this option is only changing the orientation of the models, not of the transforms. IMHO, this is not very useful, and does not seem to be very well documented either. I think I would simply avoind using this option, unless you really need to.

You can read more about the experimental ColladaMax options by clicking the link.

Maybe this illustration will help:
[ul]
[li] A pyramid created and viewed in Max, all coordinates are in the first quadrant.[/:m:1oy7f4rq][/li][li] The same pyramid as viewed in Maya, untransformed.[/:m:1oy7f4rq][/li][li] The same pyramid created and viewed in Maya, again all coordinates are in the first quadrant.[/*:m:1oy7f4rq][/ul]
[/li]
click to view the full size image