GLC_lib Logo
      GLC_lib
OpenGL Library Class Support This Project

Home

Help
Examples
Screenshots
Download
Link
Forum
News

Example06 : Loading OBJ File

 

exemple06_img

 

Now we will see how to load a 3D Model file with the GLC_Factory and display it by GLC_World class. In this example an OBJ file format is loaded.

Other supported format can be loaded in the same way. (The file extension is used by GLC_Lib to determine the file format.)

 

Sources of the example06:

Download Source and binaries of this example.

 

Only the code related to load and display the 3D model is developed.

GLWidget class

glwidget.cpp

void GLWidget::CreateScene()
{

	QFile manFile(":man.obj");
	GLC_World* pWorld= m_pFactory->createWorld(manFile);

	m_World= (*pWorld);
	delete pWorld;
}

see GLC_Factory class, and GLC_World class. Note that the copy of a GLC_World is a shallow copy.

 

 

SourceForge.net Logo

©2005-2011 Laurent Ribon