I've tried to create, and export a sphere using OpenSceneGraph. I've got no error message, but the exported .obj file is empty.
I have no idea, what do I wrong.
int main( int argc, char** argv )
{
osg::ref_ptr<osg::Group> root = new osg::Group;
osg::Sphere* unitSphere = new osg::Sphere( osg::Vec3(0,0,0), 1.0);
osg::ShapeDrawable* unitSphereDrawable = new osg::ShapeDrawable(unitSphere);
osg::Geode* basicShapesGeode = new osg::Geode();
basicShapesGeode->addDrawable(unitSphereDrawable);
root->addChild(basicShapesGeode);
osgDB::writeNodeFile(*(root.get()), "sphere.obj");
return 0;
}
I would like to export a snowman, which is just 3 spheres, one above the other. But if I try to export spheres, or other shapes, the .obj file is empty.