Hi Tuan,

The problem loading models is most likely an issue with finding the
plugins, these are now placed in a versioned osgPlugins-version
directory, so perhaps you've rearranged things from where it's expect
them to be, or not set the paths appropriately.  Set the
OSG_NOTIFY_LEVEL env var to DEBUG and then run your app to see console
output of where the OSG is looking for files and plugins.

The issue with the viewer not behaving the same, well
osgProducer::Viewer comes by default with lots of event handlers
switched on - everything and the kitchen sink style, while
osgViewer::Viewer comes with no event handlers by default assigned,
instead you need to explicitly register the event handlers your app
needs.   Have a look at the applications/osgviewer/osgviewer.cpp to
see how you add all the event handlers to get old style functionality.
 This approach is taken as its far more flexible, and much less of
black box like the old system.

As for the pixel format I don't know, you'll need Windows experts to
comment on this.  I never use Windows personally.

Robert.

On Tue, Jun 17, 2008 at 3:02 PM, Tuan Do <[EMAIL PROTECTED]> wrote:
> I used OSG 1.2 before and didn't meet problems like this. I've just tried
> OSG 2.2 with VS 2005 SP1, a simple code: loading a model.
> The code like this:
>     osg::ref_ptr<osg::Node> m_Node = new osg::Node();
>     osg::ref_ptr<osg::Group> root = NULL;
>     osgViewer::Viewer viewer;
>     osg::Vec3 nodePosit;
>     osg::ref_ptr<osg::PositionAttitudeTransform> nodeXform = NULL;
>
>     m_Node = osgDB::readNodeFile("box.flt");
>     root = new osg::Group();
>     nodeXform = new osg::PositionAttitudeTransform();
>
>     root->addChild(nodeXform.get());
>     nodeXform->addChild(m_Node.get());
>
>     nodePosit.set(5,0,0);
>     nodeXform->setPosition( nodePosit );
>     viewer.setCameraManipulator(new osgGA::TrackballManipulator());
>
>     viewer.setSceneData( root.get() );
>     viewer.realize();
>     viewer.run();
>
> I duplicated files in lib Folder and add 'd' before the extension.
> When I built it in Debug mode, it had no error but then I received a
> message:
> http://i58.photobucket.com/albums/g278/TTFTotti/error1.png
>
> Additional to it, when I built in Release mode, it run, the model loaded, I
> still could rotate and zoom the object, but I couldn't view wireframe,
> switch full-screen, windowed mode like I did with the old version. And I
> received a message in console window:
> Error: [screen #0] ChooseMatchingPixelFormat() - Unable to choose the
> requested pixel format
> http://i58.photobucket.com/albums/g278/TTFTotti/error.png
>
> Please show me the way to solve it.
> Thank you for reading!
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to