kudob
May 16, 2008, 2:47am
1
hello,
I am working on a tool that generates COLLADA .dae-files specifiing an
animated model.
Since the local representation of the model’s motion is given by
distinct 44-transformation matrices applied to each node,
I am interested if there is a possibility to design an
<animation>-<channel> which accesses the whole matrix of a node and
replaces their entries
per each time step.
Is this possible in general (e.g. by a float4 4-accessor)?
Do you know a simple example-file which shows the right semantic to be
used for this problem?
thanks very much,
kudo
<node id="N">
<matrix sid="M">1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16</matrix>
...
<animation>
...
<channel source="#matrix-sampler" target="N/M"/>
...
Yes, anytime you want to replace the entire value of the target just leave out any member selection like ‘.X’ or (11).
kudob
May 19, 2008, 12:57am
3
Thanks for your reply.
I tried to code it in an example animation, but still theres no movement at all. As testing environment i use the collada loader.
Animation:
<animation id="ANIMATION_hanim_r_shoulder">
<source id="INPUTSOURCE_hanim_r_shoulder">
<float_array id="INPUTSOURCEARRAY_hanim_r_shoulder" count="2">3 3.08333</float_array>
<technique_common>
<accessor count="2" source="#INPUTSOURCEARRAY_hanim_r_shoulder">
<param name="TIME" type="float"/>
</accessor>
</technique_common>
</source>
<source id="OUTPUTSOURCE_hanim_r_shoulder">
<float_array id="OUTPUTSOURCEARRAY_hanim_r_shoulder" count="32"> 0.346126 0.947696 -0.195225 -0.181 -0.937127 0.276711 -0.318226 0.3746 -0.240902 0.285214 0.957425 -0.061 0 0 0 1 0.3444 0.953384 -0.168795 -0.181 -0.841795 0.206335 -0.552133 0.3746 -0.478345 0.323309 0.850118 -0.061 0 0 0 1</float_array>
</source>
<sampler id="SAMPLER_hanim_r_shoulder">
<input semantic="INPUT" source="#INPUTSOURCE_hanim_r_shoulder"/>
<input semantic="OUTPUT" source="#OUTPUTSOURCE_hanim_r_shoulder"/>
</sampler>
<channel source="#SAMPLER_hanim_r_shoulder" target="hanim_r_shoulder/TRANSFORMATION_hanim_r_shoulder"/>
</animation>
Node with matrix:
<node id="hanim_r_shoulder" >
<matrix sid="TRANSFORMATION_hanim_r_shoulder">0.0538097 0.904206 -0.485346 -0.181 -0.4314 0.460915 0.810861 0.3746 0.931151 0.161288 0.403717 -0.061 0 0 0 1</matrix>
<instance_geometry url="#GEOMETRY_hanim_r_shoulder">
<bind_material>
<technique_common>
<instance_material symbol="BlueSG" target="#Blue"/>
</technique_common>
</bind_material>
</instance_geometry>
Do you see what I am doing wrong?
Thanks in advance,
Kudo