perpective and orthographic usage


I’m trying to use the collada format in one of project I work on my spare time but I have a doubt concerning the camera information on Collada 1.4 spec.

I saw that the camera tag has a technique_common and below that perspective and orthographic. I have associated those, in my mind, with glOrtho for orthographic projection and glFrustum or gluPerspective for the perspective projection in OpenGL.

It happens that I don’t really know how to use xmag and ymag and also aspect ratio in orthographic projection and xfov when in perspective projection since OpenGL don’t ask for them when setting the projection matrix.

Could anyone help me or point me out where to get such information?

Hey there,

Camera Parameters: I don’t know if these are well specified in the specs, so here’s how we interpret them:

First, an assumption: OpenGL and DirectX all start with a [-1,1] in X and [-1,1] in Y viewport: so that’s a start width/height of 2.

XMag/YMag: Magnification/Scale in the X and Y value. So, if I had [[-1,1],[-1,1]], then I get [[-XMag,XMag],[-YMag,YMag]]. The orthographic width and height are then XMag/2 and YMag/2.

The XMag and YMag are related to each other through the Aspect Ratio… as with the XFov and the YFov. Aspect Ratio = YMag/XMag or YFov/XFov. So that with the Aspect Ratio and any one other camera parameter, you can get the other camera parameter necessary to build your camera.

[Edit] Almost forgot: all the cameras in COLLADA have the value for the point at the center of the screen of (0,0). [/Edit]

Coming from Maya, you’ll get your cameras out correctly. On the other hand, from Max: you should know that it doesn’t hand out the Y-parameters or the aspect ratio, so we assume that the aspect ratio for all cameras is 1.0 on export.



Can you open a bug against the spec if it needs to have more detail about this particular element ?


I verified the spec and all that information is missing. I just created a new issues in the Khronos database. Does this information belong to the COLLADA specification?