Writing a small openscenegraph application, and in need of a way to change the Camera height. Essentially, the eye is looking straight at a Ball in the space. What I want to do is be able to lower the Camera height so I am able at the ball from below, and also raise the camera height if I need to. How do I achieve this either with oPengl code or OpenScenegraph?
int main(int argc, char* argv[])
{
osg::ref_ptr<osg::ShapeDrawable> shape2 = new osg::ShapeDrawable;
shape2->setShape( new osg::Sphere(osg::Vec3(3.0f, 0.0f, 0.0f),1.0f) );
shape2->setColor( osg::Vec4(0.0f, 0.0f, 1.0f, 1.0f) );
osg::ref_ptr<osg::Geode> root = new osg::Geode;
root->addDrawable( shape2.get() );///add first osgshapeDrawable2
osgViewer::Viewer viewer;
viewer.setSceneData( root.get() );///set the Geode as scenedata for the viewer
return viewer.run();
}