, Sr. Member
hi
the Subgeometry object expects your data to be like this:
indexdata is a vector.<uint> that descripes all triangles of the mesh by storing
3 uints for each triangle. each of this 3 stored values are indicies into the vertexData, UVData, vertexNormalData and VertexTangentdata.
the length of the indexData should allways be 3*trianglecount.
indexData=(t1,t2,t3,t1,t2,t3,t1,t2,t3,......)
the vertexData is a vector.<Number> storing x,y,z for each verticle.
the length of the vertexData should allways be 3*verticleCount.
vertexData=(x,y,z,x,y,z,x,y,z,......)
the UVData is a vector.<Number> storing u,v for each verticle.
the length of the UVData should allways be 2*verticleCount.
UVData=(x,y,z,x,y,z,x,y,z,......)
the vertexNormalData is a vector.<Number> storing normalX,normalY,normalZ for each verticle.
the length of the vertexNormalData should allways be 3*verticleCount.
vertexNormalData=(normalX,normalY,normalZ,normalX,normalY,normalZ,......)
the vertexTangentData is a vector.<Number> storing tangentX,tangentY,tangentZ for each verticle.
the length of the vertexTangentData should allways be 3*verticleCount.
vertexTangentData=(tangentX,tangentY,tangentZ,tangentX,tangentY,tangentZ,......)
vertexdata.length = vertexNormalData.length = vertexTangentData.length
vertexdata.length/3 = UVData.length/2
the indicies you store for each triangle must be multiplied by 3 to get the corresponding verticle / normal / or tangent, while ii must be multiplied by 2 to get the corresponding uv.
Note that the verticlecount is not allways trianglecount*3 because a verticle could be used by more then one triangle. triangles that share points between each other will be rendered with smooth edges, while not sharing points preserves hard edges.
80