[osg-users] Wrapper class question

2012-07-24 Thread Jo Mo
Hi,

I have just started using OSG and came across the wrapper classes in the 
osgWrapper directory. However, I don't quite understand what these .cpp files 
are exactly doing / what I can use them for. They all contain a 
REGISTER_OBJECT_WRAPPER Macro, but I don't understand what this definition 
(defined in ObjectWrapper) is actually doing. Maybe somebody could give a short 
explanation of these wrappers and tell me when I should use them.

Thank you!

Cheers,

Jo

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=48949#48949





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] place osgtext above moving object

2012-03-13 Thread jo mo
Hi,

I have a scene with moving teams (represented as spheres) and I want to place 
an osgText above each of these team such that the text movels along the object. 
I tried the following code (teamPos is the node representing the team, lat, lon 
and z is the current team position): 

osg::ref_ptr teamLabel = new osgText::Text();
osg::ref_ptr g_font = 
osgText::readFontFile("fonts/arial.ttf");

teamLabel->setDataVariance(osg::Object::DYNAMIC);
teamLabel->setFont(g_font.get());
teamLabel->setCharacterSize( 100.0 );
teamLabel->setFontResolution( 22, 22 );
teamLabel->setColor( osg::Vec4(1.0,1.0,1.0,0.5) );
teamLabel->setPosition( osg::Vec3f(lon,lat,z) );
teamLabel->setAlignment( osgText::Text::CENTER_TOP );
teamLabel->setAxisAlignment(osgText::TextBase::SCREEN);
teamLabel->setCharacterSizeMode( osgText::Text::SCREEN_COORDS );
teamLabel->setBackdropType( osgText::Text::OUTLINE );
teamLabel->setBackdropColor( osg::Vec4(0,0,0,1) ); 
teamLabel->setBackdropImplementation( osgText::Text::STENCIL_BUFFER 
);
teamLabel->setBackdropOffset(0.2f,0.2f);
teamLabel->setAutoRotateToScreen( true );
teamLabel->setText( teamString.toStdString().c_str() );

osg::ref_ptr positionGeode = new osg::Geode;
positionGeode->addDrawable(teamPos);
positionGeode->addDrawable(teamLabel);

Has anybody got an idea what I am doing wrong?

Thank you!

Cheers,
jo

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=46089#46089





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org