Hi Roni,

Thanks for the modified example.  I much prefer avoid use of globals
so have modified the code to get the scene graph from the view, so the
code now looks like:


                if (ea.getKey() == 'o' )
                {
                    osgViewer::View* view = dynamic_cast<osgViewer::View*>(&aa);
                    osg::Node* node = view ? view->getSceneData() : 0;
                    if (node)
                    {
                        osgDB::writeNodeFile(*node, "hud.osgt");
                        osgDB::writeNodeFile(*node, "hud.osgb");
                    }
                    return true;
                }


With this I am able to see the bug with writing out the hud.osgb, but
it works fine with hud.osgb.  Curiously if I do a:

   osgconv hud.osgb hud2.osgt

The resulting file is almost identical to hub.osgt (only difference is
the root node name for the filename) and it works fine too.  So
something in the osg::Camera set up looks to be the issue.  It's a bit
odd for sure, setting a property to the same value shouldn't change
the overall behaviour, so I wonder if perhaps the defaults for the
serializer might be different from the default for osg::Camera.

Robert.


On 9 June 2015 at 02:43, Roni Zanolli <[email protected]> wrote:
> Hi Robert,
>
> I'm sorry I knew the changes was done for a reason I looked the log but
> I guess I missed. I also posted a question on the General forum but
> I had no response.
>
> Anyway I had modified and attached to this post the osghud example so you can 
> see the problem.
> After running the example with no arguments just press the key 'o' to write a 
> hud.osgb file and then try to open using osgviewer. You will see the truck 
> model but the hud text will not show.
>
> Thanks,
>
> Roni
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=63990#63990
>
>
>
>
> Attachments:
> http://forum.openscenegraph.org//files/osghud_759.zip
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to