![]() |
GLC_lib | |||||||
| OpenGL Library Class | ||||||||
Now we will see how to texturing objects with GLC_Texture class and how to add a background image with GLC_Viewport class.
Download Source and binaries of this example.
Only the code related to texture and background image is developed.
// Create GLC_Object to display void GLWidget::CreateScene() { // Load Backfround image. m_GlView.loadBackGroundImage(":fond_exemple07.png"); // create a material with the specified texture GLC_Texture* pTexture= m_pFactory->createTexture(QString::fromAscii(":exemple07.png")); // Load "example07.obj" QFile fileEx07(":example07.obj"); GLC_World* pWorld= m_pFactory->createWorld(fileEx07); m_World= (*pWorld); m_World.collection()->instancesHandle().first()->geomAt(0)->firstMaterial()->setTexture(pTexture); delete pWorld; }
| ©2005-2010 Laurent Ribon |