From: Mars999 <ma...@si...> - 2009-10-13 04:45:57
|
Ok I am using this now and no more crashes... vertexTCData.push_back(scene->mMeshes[i]->mTextureCoords[0][j].x); vertexTCData.push_back(scene->mMeshes[i]->mTextureCoords[0][j].y); So do I use the mNumUVComponents to take the place of 0 in the 2Darray? I am assuming this is for meshes that have more than one set of UV coords? Thanks Mars999 wrote: > I am having some trouble getting the texcoords out of the aimesh for > some reason.... > > I do this with the vertex data and works fine > > //vertex data > for(int i = 0; i < scene->mNumMeshes; ++i) > for(int j = 0; j < scene->mMeshes[i]->mNumVertices; ++j) > { > vertexData.push_back(scene->mMeshes[i]->mVertices[j].x); > vertexData.push_back(scene->mMeshes[i]->mVertices[j].y); > vertexData.push_back(scene->mMeshes[i]->mVertices[j].z); > > //tc > //vertex data > for(int i = 0; i < scene->mNumMeshes; ++i) > for(int j = 0; j < scene->mMeshes[i]->mNumVertices; ++j) > { > vertexData.push_back(scene->mMeshes[i]->mVertices[j].x); > vertexData.push_back(scene->mMeshes[i]->mVertices[j].y); > vertexData.push_back(scene->mMeshes[i]->mVertices[j].z); > //tc > > vertexTCData.push_back(scene->mMeshes[i]->mTextureCoords[j].x); > > vertexTCData.push_back(scene->mMeshes[i]->mTextureCoords[j].y); > } > > > here is the error i get > > /Developer/Work/GLUTMesh/main.cpp:82:0 > /Developer/Work/GLUTMesh/main.cpp:82: error: request for member 'x' in > '(*(((aiMesh**)scene->aiScene::mMeshes) + ((aiMesh**)(((long unsigned > int)i) * 8ul))))->aiMesh::mTextureCoords[j]', which is of non-class > type 'aiVector3D*' > > > Thanks for helping! > > |