Texture matrix

What’s the appropriate way to write out the texture matrix to a dae file?
What is, I want to define a <matrix> element that is only applied to the vertex input of the bound material, but not the vertex positions and normals of the instance geometry.
If I have the following library of nodes:

    <node id="ID3" name="component_0">
      <instance_geometry url="#ID4">
            <instance_material symbol="Material1" target="#ID5">
              <bind_vertex_input input_semantic="TEXCOORD" input_set="0" semantic="UVSET0"/>

how would I write the texture matrix that would be applied to the uv coords?


If I understand you correctly, you would like to have e.g. a 2x2 matrix that will be applied to the 2 dimensional uv coordinates? Than these transformed uv coordinates will be used to place the texture?

Such a transformation is not supported in COLLADA. We have encountered the same problem, while writing our COLLADAMax and COLLADAMaya plug-ins, as both, 3ds Max and Maya, support rotation and translation of uv coordinates.
Something that Google wants to champion in the 1.5.1 specification? :wink:


Actually, you can store the texture matrix as a <newparam> in the scope of <effect> and also in any COLLADA FX profile except for <profile_BRIDGE>.

For this use-case, In <effect> scope it can be any supported matrix size. While in <profile_COMMON> the type of parameter can at most be a float4 which is sufficient storage for a 2x2 matrix. You can build a larger matrix using more then one parameter.

Inside <bind_material> you can use <param> to assist in resolving the binding too.