Esempio n. 1
0
bool CMeshLoader::loadVertexBufferObjectFromMesh(std::string const & fileName, int & TriangleCount, GLuint & PositionBufferHandle, GLuint & ColorBufferHandle)
{
	CMesh * Mesh = loadASCIIMesh(fileName);
	if (! Mesh)
		return false;

    //ADD code to resize the mesh and to reposition it at the origin

    //ADD code to create a VBO for the mesh
	
	return true;
}
Esempio n. 2
0
bool CMeshLoader::loadVertexBufferObjectFromMesh(std::string const & fileName, int & TriangleCount, GLuint & PositionBufferHandle, GLuint & ColorBufferHandle, GLuint & NormalBufferHandle)
{
	CMesh * Mesh = loadASCIIMesh(fileName);
	if (! Mesh)
		return false;
   
	Mesh->resizeMesh(SVector3(1));
	Mesh->centerMeshByExtents(SVector3(0));
   Mesh->computeNormals();
   
	createVertexBufferObject(* Mesh, TriangleCount, PositionBufferHandle, ColorBufferHandle, NormalBufferHandle);
	
	return true;
}