本文整理汇总了C++中Mesh::BuildTextureData方法的典型用法代码示例。如果您正苦于以下问题:C++ Mesh::BuildTextureData方法的具体用法?C++ Mesh::BuildTextureData怎么用?C++ Mesh::BuildTextureData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mesh
的用法示例。
在下文中一共展示了Mesh::BuildTextureData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
// Builds the model from the 3DS file data
// Returns true for success false otherwise
bool ModelLoader::buildFrom3DS(Mesh &mesh, unsigned int meshNum)
{
// Make sure we have valid objects just in case.
if(m_3DModel.pObject.size() <= 0){
return false;
}
// Get the current object that we want to build
Object3DS *pObject = &m_3DModel.pObject[meshNum];
int numTexCoords = pObject->numTexVertex;
int numVerts = pObject->numOfVerts;
int numIndices = pObject->numOfFaces*3;
// If the number of texture coordinates does not equal
// the number of (x,y,z) positions, skip this mesh object. We
// only handle mesh objects that have an equal number of (x,y,z)'s and
// (u,v)'s
if(numTexCoords != numVerts)
return false;
// Check to see if this object has a texture map, build a texture for it
if(pObject->bHasTexture){
const char* name = m_3DModel.pMaterials[pObject->materialID].strFile;
mesh.BuildTextureData(name);
}
mesh.BuildVertexData(pObject, numVerts, numTexCoords, numIndices);
return true;
}