Problems exporting dae file, 3dsmax reads everything 0...

Hi everybody,

I am trying to create a DAE exporter for my application. I took the exporter example from the collada dom and I modified to fit into my code. I’m just exporting the geometry and the texture image, nothing else. I dont know why when I try to load the dae file in 3DSmax I get the model with all positions in 0,0,0… Here you have my code and the dae resulting attached:

void DAEConverter::addGeometry() {
SafeAdd(myRoot, “library_geometries”, geomLib);
SafeAdd(geomLib, “geometry”, geom);
string geomID = “body”;
geom->setAttribute(“id”, geomID.c_str());
SafeAdd(geom, “mesh”, mesh);

// Add the position data

domFloat *posArray = new domFloat[3*myGeom->mVertexCount];
for(int i = 0; i < 3*myGeom->mVertexCount; i++)
	posArray[i] = (domFloat)myGeom->mVertices[i];

addSource(mesh, geomID + "-positions", "X Y Z", posArray, 3*myGeom->mVertexCount);

// Add the normal data
domFloat *normalArray = new domFloat[3*myGeom->mNormalsCount];
for(int i = 0; i < 3*myGeom->mNormalsCount; i++)
	normalArray[i] = (domFloat)myGeom->mNormals[i];

addSource(mesh, geomID + "-normals", "X Y Z", normalArray, 3*myGeom->mNormalsCount);

// Add the tex coord data
domFloat *uvArray = new domFloat[2*myGeom->mTexCount];
for(int i = 0; i < 2*myGeom->mTexCount; i++)
	uvArray[i] = (domFloat)myGeom->mTexCoords[i];

addSource(mesh, geomID + "-uv", "S T", uvArray, 2*myGeom->mTexCount);

// Add the <vertices> element
SafeAdd(mesh, "vertices", vertices);
vertices->setAttribute("id", (geomID + "-vertices").c_str());
SafeAdd(vertices, "input", verticesInput);
verticesInput->setAttribute("semantic", "POSITION");
verticesInput->setAttribute("source", makeUriRef(geomID + "-positions").c_str());

SafeAdd(vertices, "input", normalsInput);
normalsInput->setAttribute("semantic", "NORMAL");
normalsInput->setAttribute("source", makeUriRef(geomID + "-normals").c_str());

SafeAdd(vertices, "input", texturesInput);
texturesInput->setAttribute("semantic", "TEXCOORD");
texturesInput->setAttribute("source", makeUriRef(geomID + "-uv").c_str());

// Add the <triangles> element.
// Each line is one triangle.
int count = myGeom->mTriCount*3;
domUint *indices = new domUint[count];

for(int i = 0; i < myGeom->mTriCount*3; i++)
	indices[i] = myGeom->mIndices[i];

domTriangles* triangles = daeSafeCast<domTriangles>(mesh->add("triangles"));
triangles->setCount(count/3);//(3*3)); // 3 indices per vertex, 3 vertices per triangle

addInput(triangles, "VERTEX",   geomID + "-vertices", 0);

domP* p = daeSafeCast<domP>(triangles->add("p"));
p->getValue() = rawArrayToDaeArray(indices, count);

}

Please does anybody see what’s the problem??

best,
Jaime.