Geometry and Camera questions

here comes a piece of a .DAE cod:

<library_geometries>
<geometry id=“mesh1-geometry”>
<mesh>
<source id=“mesh1-geometry-position”>
<float_array id=“mesh1-geometry-position-array” count=“24”>13.227612 14.653773 0.000000 -13.612388 -12.186227 0.000000 -13.612388 14.653773 0.000000 13.227612 -12.186227 0.000000 13.227612 -12.186227 17.560000 13.227612 14.653773 17.560000 -13.612388 14.653773 17.560000 -13.612388 -12.186227 17.560000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count=“8” stride=“3”>
<param name=“X” type=“float”/>
<param name=“Y” type=“float”/>
<param name=“Z” type=“float”/>
</accessor>
</technique_common>
</source>
<source id=“mesh1-geometry-normal”>
<float_array id=“mesh1-geometry-normal-array” count=“18”>0.000000 0.000000 -1.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 -1.000000 0.000000 0.000000 0.000000 -1.000000 0.000000 0.000000 0.000000 1.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count=“6” stride=“3”>
<param name=“X” type=“float”/>
<param name=“Y” type=“float”/>
<param name=“Z” type=“float”/>
</accessor>
</technique_common>
</source>
<source id=“mesh1-geometry-uv”>
<float_array id=“mesh1-geometry-uv-array” count=“48”>-0.661381 0.732689 0.680619 -0.609311 0.680619 0.732689 -0.661381 -0.609311 0.732689 0.000000 -0.609311 0.878000 -0.609311 0.000000 0.732689 0.878000 -0.661381 0.000000 0.680619 0.878000 -0.661381 0.878000 0.680619 0.000000 0.609311 0.000000 -0.732689 0.878000 -0.732689 0.000000 0.609311 0.878000 -0.680619 0.000000 0.661381 0.878000 -0.680619 0.878000 0.661381 0.000000 0.661381 -0.609311 -0.680619 0.732689 -0.680619 -0.609311 0.661381 0.732689 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count=“24” stride=“2”>
<param name=“S” type=“float”/>
<param name=“T” type=“float”/>
</accessor>
</technique_common>
</source>
<vertices id=“mesh1-geometry-vertex”>
<input semantic=“POSITION” source="#mesh1-geometry-position"/>
</vertices>
<triangles material=“material0” count=“12”>
<input semantic=“VERTEX” source="#mesh1-geometry-vertex" offset=“0”/>
<input semantic=“NORMAL” source="#mesh1-geometry-normal" offset=“1”/>
<input semantic=“TEXCOORD” source="#mesh1-geometry-uv" offset=“2” set=“0”/>

0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 0 1 4 4 1 5 3 1 6 4 1 5 0 1 4 5 1 7 0 2 8 6 2 9 5 2 10 6 2 9 0 2 8 2 2 11 1 3 12 6 3 13 2 3 14 6 3 13 1 3 12 7 3 15 1 4 16 4 4 17 7 4 18 4 4 17 1 4 16 3 4 19 4 5 20 6 5 21 7 5 22 6 5 21 4 5 20 5 5 23 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id=“Camera-camera”>
<optics>
<technique_common>
<perspective>
<yfov>45</yfov>
<aspect_ratio>1.33333</aspect_ratio>
<znear>0.0</znear>
<zfar>100.0</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id=“Cena”>
<node id=“mesh1”>
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol=“material0” target="#material0ID">
<bind_vertex_input semantic=“UVSET0” input_semantic=“TEXCOORD” input_set=“0”/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
<node id=“Camera”>
<matrix>
0.771212 -0.327020 0.546160 43.236103
0.636579 0.396183 -0.661669 -52.053594
0.000000 0.857961 0.513715 49.655758
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#Cena"/>
</scene>

I got 4 questions:
1)The normal array is optinal? what happens if i dont use it?
2)Why the texture array is 2d? I have no ideia what are these texture coords
(-0.661381 0.732689 0.680619 -0.609311…)
3)What means the tag matrix inside the tag node(id=“Camera”), what means this coords and the are 2d or 3d?
4)In :
<input semantic=“TEXCOORD” source="#mesh1-geometry-uv" offset=“2” set=“0”/>
what means set=“0”?

use the “[“code”]” and “[”/code"]" for posting code, easier to read :slight_smile:

the you get:


<library_geometries>
<geometry id="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="24">13.227612 14.653773 0.000000 -13.612388 -12.186227 0.000000 -13.612388 14.653773 0.000000 13.227612 -12.186227 0.000000 13.227612 -12.186227 17.560000 13.227612 14.653773 17.560000 -13.612388 14.653773 17.560000 -13.612388 -12.186227 17.560000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="8" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="18">0.000000 0.000000 -1.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 -1.000000 0.000000 0.000000 0.000000 -1.000000 0.000000 0.000000 0.000000 1.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="6" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="48">-0.661381 0.732689 0.680619 -0.609311 0.680619 0.732689 -0.661381 -0.609311 0.732689 0.000000 -0.609311 0.878000 -0.609311 0.000000 0.732689 0.878000 -0.661381 0.000000 0.680619 0.878000 -0.661381 0.878000 0.680619 0.000000 0.609311 0.000000 -0.732689 0.878000 -0.732689 0.000000 0.609311 0.878000 -0.680619 0.000000 0.661381 0.878000 -0.680619 0.878000 0.661381 0.000000 0.661381 -0.609311 -0.680619 0.732689 -0.680619 -0.609311 0.661381 0.732689 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="24" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="12">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>


0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 0 1 4 4 1 5 3 1 6 4 1 5 0 1 4 5 1 7 0 2 8 6 2 9 5 2 10 6 2 9 0 2 8 2 2 11 1 3 12 6 3 13 2 3 14 6 3 13 1 3 12 7 3 15 1 4 16 4 4 17 7 4 18 4 4 17 1 4 16 3 4 19 4 5 20 6 5 21 7 5 22 6 5 21 4 5 20 5 5 23 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera"> 
<optics> 
<technique_common> 
<perspective>
<yfov>45</yfov>
<aspect_ratio>1.33333</aspect_ratio>
<znear>0.0</znear>
<zfar>100.0</zfar>
</perspective> 
</technique_common> 
</optics> 
</camera> 
</library_cameras> 
<library_visual_scenes> 
<visual_scene id="Cena"> 
<node id="mesh1"> 
<instance_geometry url="#mesh1-geometry"> 
<bind_material> 
<technique_common> 
<instance_material symbol="material0" target="#material0ID"> 
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/> 
</instance_material> 
</technique_common> 
</bind_material> 
</instance_geometry> 
</node> 
<node id="Camera"> 
<matrix> 
0.771212 -0.327020 0.546160 43.236103 
0.636579 0.396183 -0.661669 -52.053594 
0.000000 0.857961 0.513715 49.655758 
0.000000 0.000000 0.000000 1.000000 
</matrix> 
<instance_camera url="#Camera-camera"/> 
</node> 
</visual_scene> 
</library_visual_scenes> 
<scene> 
<instance_visual_scene url="#Cena"/> 
</scene>

A model can have several sets of texture cordinates:

Ex:

the artist may have one uv mapping for the diffuse map and another one for the specular map.

well before answering more question, what are you trying to do??

are you imporing a collada file into an application?

I am trying to use .DAE models on GoogleEarth.

I got all this questions solved, but a have other questions:

  1. Why polylist or polygon dont work on google Earth?
    *i am using triangles to draw everythins, because of that.

2)Is there any pattern for texture coords?i didnt undestand those values for the example up here.

In OpenGL i got a pattern to insert a photo in a plane:

bottom left is 0,0 and 1,1 is the top right of my photo.