Hi Frank Problem: osgText::Text and osgText::Text3D use the same font file. The first really load the file and obtain an osgText::Font object, the second use the cache created during the first load of the font file, and so obtain an osgText::Font object instead of osgText::Font3D object. To obtain an osgText::Font3D object, osgText::Text3D call osgDB::readObjectFile(...) with an option to specify the plugin we want an osgText::Font3D instead of osgText::Font.
Generalised Problem: In osgDB::Registry, loaded file cache is referenced by the name of this file, so if I load a file with some options, and the cache already contain object for this filename, I obtain an object potentially not loaded with my options. Behaviours: Cache management is delegate to osgDB::Registry, but cache coherence (load a file with option then reuse it, deactivate the cache when load a specific file or don't cached the loaded file) is user's responsibility. Text3D case: Delegate the cache coherence of font file in osgText to the user is not a good idea. So to fix this I think to 2 solution: - never use the cache when load a font for a Text3D. Just because to load a Font3D, we use option in osgDB::readObjectFile() - move osgText::Font3D implementation in osgText::Font, suffix ex-Font3D method with "3D" in osgText::Font (so osgText::Font3D::getGlyph() become osgText::Font::getGlyph3D() ) And so Text and Text3D use the same osgText::Font object which contain 2D and 3D glyph. Thought, Robert, Other ? David Callu 2009/2/19 David Callu <led...@gmail.com> > Hi Frank, > > This is a bug. > I take a look. > > more in next episode. > Cheer > > David Callu > > 2009/2/18 <frankmil...@jhmi.edu> > >> Greetings, >> >> I am experiencing problems rendering osgText::Text and osgText::Text3D >> in the same scene. I have boiled it down to a nice bite-size chunk of >> code which I have attached. I am running version 2.8. >> >> Is this a bug? >> >> Frank >> >> >> _______________________________________________ >> 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