Hi Guido, >From what you've written it's next to impossible to know what is amiss - there is simply too many unkowns about what you are doing for us to guess.
The best I can do is highlight a couple of oddities. First up the warning about NaN from CullVisitor suggests that that the cull traversal has an invalid matrix being passed to it, or perhaps an invalid matrix in the scene graph - can't pin point what, guess guess would be something amiss at the top level i.e. viewer's camera. Second odd thing is about adding Camera's to the GraphicsContext, in normal OSG usage I wouldn't expect users to be doing this as when you using osgViewer normally it'll set up all the contexts and cameras correctly for you. The only time I'd expect users to add a Camera to GraphicsContext directly is when doing a custom hud style overlay such as done by the osgViewer StatsHandler. However, most users will do HUD's via a Viewer level Camera or a Camera in the scene graph, it's only in very specific cases would you ever add a Camera directly. Third thing that seems odd is C style case of graficcontext to osg::GraphicsContext. I hav no clue what type graficontext is but it it's a an actual subclass from osg::GraphicsContext then you'll never need to cast it, and if it isn't then casting an object of a totally different type ain't going to work - it's a basic C++ error. Robert. On Sat, Aug 20, 2011 at 11:02 PM, Guido Lucci Baldassari <[email protected]> wrote: > Good evening to everyone > I'm not very skilled using osg itself, so maybe everything I'm going to say > below is wrong. > > Anyway: > I have a problem displaying osg content with my plugin, since I updated to > OSG 3. > Inside my extension, I create a CGLContextObj, then I pass it to osgviewer. > From the debugging messages (ativated at "defcon 5" - DEBUG :) ) appears that > the viewer is up and running, the model is loaded, but not displayed. > The problem apparently lies here (but maybe I'm wrong... anyway I'd like to > fix this point) > > ... > _MainCamera(new osg::Camera), > ... > ... > ... > osg::ref_ptr<osg::GraphicsContext> gc = (osg::GraphicsContext*) graficcontext; > _MainCamera->setGraphicsContext(gc.get()); > ... > > The output that I got in the Console is: > > ... > 20.08.11 16:53:21 [0x0-0xf60f6].com.google.Chrome[7790] > CullVisitor::apply(Geode&) detected NaN, > 20.08.11 16:53:21 [0x0-0xf60f6].com.google.Chrome[7790] > depth=nan, center=(11412 18917 300), > 20.08.11 16:53:21 [0x0-0xf60f6].com.google.Chrome[7790] matrix={ > 20.08.11 16:53:21 [0x0-0xf60f6].com.google.Chrome[7790] nan > nan nan nan > 20.08.11 16:53:21 [0x0-0xf60f6].com.google.Chrome[7790] nan > nan nan nan > 20.08.11 16:53:21 [0x0-0xf60f6].com.google.Chrome[7790] nan > nan nan nan > 20.08.11 16:53:21 [0x0-0xf60f6].com.google.Chrome[7790] nan > nan nan nan > 20.08.11 16:53:21 [0x0-0xf60f6].com.google.Chrome[7790] } > ... > > > Apparently, without this last line, before the update to v3.0.0, everything > worked well on Mac OSX (was commented). > Now probably the lack of this line is the one that creates the problem ... it > is the only big difference between osx and windows implementation (that works > correctly!). > Am I right? > > So I tried to set the line > _MainCamera->setGraphicsContext(gc.get()); > but it crashes... > I tried also with > gc->osg::GraphicsContext::addCamera(_MainCamera); > gc->_cameras.push_back(_MainCamera); > but obviously the compiler complains about protections. ;) > Any suggestion? > Thanks in advance. > G. > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

