01 SoSeparator* drawEarth() 02 { 03 // Objects for group nodes and texture 04 SoSeparator *earth = new SoSeparator; 05 SoTexture2 *texture_earth = new SoTexture2; 06 07 // Name of texture file 08 texture_earth->filename = "worldmap.rgb"; 09 10 // Add texture to group node 11 earth->addChild(texture_earth); 12 13 // Add sphere to group node 14 // => Draw texture on surface of sphere 15 earth->addChild(new SoSphere); 16 17 return earth; 18 }