Hi, I've been trying to setup a sky background. When my scene is being shown
it doesn't draw the background. I'm probably missing some settings here. The
code i'm using is:

   OSG::beginEditCP(sky);
       sky->setBackTexture(createTexture("textures/envdown.jpg") );
       sky->setFrontTexture(createTexture("textures/envup.jpg") );
       sky->setLeftTexture(createTexture("textures/envwest.jpg") );
       sky->setRightTexture(createTexture("textures/enveast.jpg") );
       sky->setBottomTexture(createTexture("textures/envsouth.jpg") );
       sky->setTopTexture(createTexture("textures/envnorth.jpg") );
   endEditCP(sky);

   beginEditCP(topViewport);
       topViewport->setCamera(topCamera);
       topViewport->setBackground(sky);
       topViewport->setRoot(scene);
       topViewport->setSize(0.8,0.8,1,1);
   endEditCP(topViewport);

TextureChunkPtr SceneFactory::createTexture(char *file)
{
   ImagePtr image = Image::create();
   beginEditCP(image);
       image->read(file);
   endEditCP(image);

   TextureChunkPtr chunk = TextureChunk::create();
   beginEditCP(chunk);
       chunk->setImage(image);
   endEditCP(chunk);

   return chunk;
}

Can anyone point me in the right direction?

Thanks in advance.
Frederik
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to