That's how it should look.

You've set the viewport up to take a quarter  of the screen and you
don't have a camera manipulator,
so your camera will be in the default location, which usually means
you aren't looking at anything.

Remove the /2 in the viewport setup or add some more view ports to
fill the rest of the window.

To look at some thing you either need a camera manipulator:

pView->setCameraManipulator(new osgGA::TrackballManipulator);

or you need to write your own code to orientation the camera's viewMatrix.

2009/7/24 Vic Ace <[email protected]>:
> Ok, now the code looks like this and I have attached a pic of how this 
> renders. A bit odd.
>
>
> Code:
> osg::ref_ptr<osgViewer::CompositeViewer> viewer = new 
> osgViewer::CompositeViewer;
>
> osg::ref_ptr<osg::GraphicsContext::Traits> traits = new 
> osg::GraphicsContext::Traits;
> traits->x = 100;
> traits->y = 100;
> traits->width = 800;
> traits->height = 600;
> traits->depth = 16;
> traits->windowDecoration = true;
> traits->supportsResize = false;
> traits->windowName = "TEST";
> traits->doubleBuffer = true;
>
> osg::ref_ptr<osg::GraphicsContext> graphicscontext = 
> osg::GraphicsContext::createGraphicsContext(traits);
>
> osg::ref_ptr<osg::Group> root = new osg::Group;
> osg::ref_ptr<osg::Geode> geode = new osg::Geode;
> osg::ref_ptr<osg::Capsule> capsule = new osg::Capsule(osg::Vec3(), 1, 2);
> osg::ref_ptr<osg::ShapeDrawable> drawable = new osg::ShapeDrawable(capsule);
> geode->addDrawable(drawable);
> root->addChild(geode);
>
> osg::ref_ptr<osgViewer::View> view = new osgViewer::View;
> viewer->addView(view);
> view->setSceneData(root);
> view->getCamera()->setGraphicsContext(graphicscontext);
> view->getCamera()->setClearColor(osg::Vec4f(0.2f, 0.2f, 0.6f, 1.0f));
> view->getCamera()->setViewport(new osg::Viewport(0 , 0, traits->width / 2, 
> traits->height / 2));
>
>
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=15412#15412
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>



-- 
http://www.ssTk.co.uk
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to