Applying <lookat> transforms


I’m a little confused as to how to handle the <lookat> transform. As far as I can tell, this transform is for cameras only, so does that mean that I should ignore it unless the node has a camera? If a camera is instantiated and a lookat transform exists on the node, should it ignore any other transforms or should I somehow convert the lookat transform into a matrix and concatenate it with the other matrices like usual?


You treat the <lookat> just like any other transform. It gets post multiplied in the transform stack.

Each transform can be thought of as a matrix and they all get concatenated together in the order they are specified. <lookat> acts the same as the OpenGL gluLookAt function. As you may recall gluLookAt applies the matrix to the current matrix. The GL API doesn’t make any difference what matrix mode you are in, could be MODELVIEW, PROJECTION, or even TEXTURE matrix. That is the same as COLLADA works.


Ah, seems I was overthinking.