Create a textured sphere in Blender. The texture image has
to be of some spherical object, such as a planet's surface or a
soccer ball. Export it as an OpenSceneGraph tree and render
textured spheres in place of the rocking horses on the outer
disk of homework 4: example image.
If importing the texture does not work: a) check the .osg
file if the image's filename is correct. b) check that the
texture file is in the same directory as the osg file. c) if
neither of those was the problem, remove the node "textureUnit
0 {...}" from the osg file and load the texture from within
your OpenSceneGraph code with the following commands:
osg::Texture2D* tex = new osg::Texture2D();
tex->setImage( osgDB::readImageFile( "mytexture.jpg" ));
osg::StateSet* ss = new osg::StateSet();
loadedModel->setStateSet(ss);
ss->setTextureAttributeAndModes(0, tex, osg::StateAttribute::ON);