HI Alessandro,

The black screen is down to you probably neither assigning a
CameraManipulator that would set the viewer's Camera view matrix or
setting this yourself.

The reason why run() method itself will automatically register a
trackball manipulator if you haven't already assigned one.

try:


 while(!viewer.done())
 {
    viewer.getCamera()->setViewMatrix(viewMatrix); // some sensible
viewMatrix value...
    viewer.frame();
 }

OR

 viewer.setCameraManipulator(new osgGA::TrackballManipulator);

 while(!viewer.done())
 {
    viewer.frame();
 }



Robert.

On 3/31/07, alessandro terenzi <[EMAIL PROTECTED]> wrote:
I'd like to do some actions during the main loop of my application but I
have some problems with osgViewer. In particular I can display anything if I
use osgViewer::run method but if I replace the call to run() with:

...
viewer.realize();
while(!viewer.done())
{
   viewer.frame();
}
...

I got a black screen.
What am I missing? Looking at the comments in the source code for the run()
method it looks like that the latter is equivalent to the while loop, isn't
it? Have I to init something earlier in the code?

Thanks.
Alessandro
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to