Hello
I’m working on some directx application and want to read meshes from collada. I create geometry by reading info about vertex position and indices, and everything is ok, i can render correct objects, but when i want to apply textures on object i got problem with texture coordinates.
the image below shows how my object looks in 3dsmax (a simple example with plane):
here is the part of the code after exporting it from max:
<library_geometries>
<geometry id="Plane01-obj" name="Plane01">
<mesh>
<source id="Plane01-obj-position">
<float_array id="Plane01-obj-position-array" count="12">-0.500000 -0.500000 0 0.500000 -0.500000 0 -0.500000 0.500000 0 0.500000 0.500000 0</float_array>
<technique_common>
<accessor source="#Plane01-obj-position-array" count="4" stride="3">
<param name="X" type="float"></param>
<param name="Y" type="float"></param>
<param name="Z" type="float"></param>
</accessor>
</technique_common>
</source>
<source id="Plane01-obj-normal">
<float_array id="Plane01-obj-normal-array" count="12">0 0 1.000000 0 0 1.000000 0 0 1.000000 0 0 1.000000</float_array>
<technique_common>
<accessor source="#Plane01-obj-normal-array" count="4" stride="3">
<param name="X" type="float"></param>
<param name="Y" type="float"></param>
<param name="Z" type="float"></param>
</accessor>
</technique_common>
</source>
<source id="Plane01-obj-mapchan-1">
<float_array id="Plane01-obj-mapchan-1-array" count="12">0 0 0 1.000000 0 0 0 1.000000 0 1.000000 1.000000 0</float_array>
<technique_common>
<accessor source="#Plane01-obj-mapchan-1-array" count="4" stride="3">
<param name="S" type="float"></param>
<param name="T" type="float"></param>
<param name="R" type="float"></param>
</accessor>
</technique_common>
</source>
<vertices id="Plane01-obj-vertex">
<input semantic="POSITION" source="#Plane01-obj-position"></input>
</vertices>
<triangles material="_01_-_Default" count="2">
<input semantic="VERTEX" source="#Plane01-obj-vertex" offset="0"></input>
<input semantic="NORMAL" source="#Plane01-obj-normal" offset="1"></input>
<input semantic="TEXCOORD" source="#Plane01-obj-mapchan-1" offset="2" set="1"></input>
0 0 0 1 1 1 3 2 3 3 2 3 2 3 2 0 0 0 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
i thought that every vertex (x,y,z) got corresponding (u,v,w) coords. This is how i think:
x y z u v w
-0.500000 -0.500000 0 0 0 0
0.500000 -0.500000 0 1.000000 0 0
-0.500000 0.500000 0 0 1.000000 0
0.500000 0.500000 0 1.000000 1.000000 0
indices for vertices
0 1 3 3 2 0
as you can see the (0,0) texture coords goes for vertex 0 which is different with that what i got in 3dsmax.
i understad the vertex positions but don’t understand the way how collada define texture coordinates. maybe you could give me some links where i can read about it. :oops:
i think i’ve just solved it, 3dsmax texture coordinates differ from those in dx :oops: omg