[osg-users] Insert an image before a text

Robert Osfield robert.osfield at gmail.com
Wed Dec 16 00:51:56 PST 2020


Images won't render on their own you need to create some geometry to render
the texture on.  You don't mentioned anything about creating geometry but
it could easily by that you've just not mentioned it.

There is a convenience function for created a quad geometry appropriate for
rendering textures on, see:

   osg::createTexturedQuadGeometry()

The OSG examples that use this are:
:~/Dev/OpenSceneGraph/examples$ grep -r "osg::createTexturedQuadGeometry" .
./osgmovie/osgmovie.cpp:        osg::Geometry* pictureQuad =
osg::createTexturedQuadGeometry(pos,
./osgmovie/osgmovie.cpp:        osg::Geometry* pictureQuad =
osg::createTexturedQuadGeometry(pos,
./osgatomiccounter/osgatomiccounter.cpp:        osg::Geometry * quad =
osg::createTexturedQuadGeometry(osg::Vec3f(-2.0f, 0.0f, -2.0f),
./osgcomputeshaders/osgcomputeshaders.cpp:    osg::Geometry* geom =
osg::createTexturedQuadGeometry(
./osgtext3D/osgtext3D.cpp:            geode->addDrawable(
osg::createTexturedQuadGeometry(osg::Vec3(0.0f,characterSize*thickness,0.0f),osg::Vec3(characterSize,0.0,0.0),osg::Vec3(0.0f,0.0,characterSize),
0.0, 0.0, 1.0, 1.0) );
./osgcatch/osgcatch.cpp:        osg::Geometry* geometry =
osg::createTexturedQuadGeometry(pos,width,height);
./osgcatch/osgcatch.cpp:            osg::Geometry* geometry =
osg::createTexturedQuadGeometry(pos,width,height);
./osgcatch/osgcatch.cpp:            osg::Geometry* geometry =
osg::createTexturedQuadGeometry(pos,width,height);
./osgcatch/osgcatch.cpp:            osg::Geometry* geometry =
osg::createTexturedQuadGeometry(pos,width,height);
./osgcatch/osgcatch.cpp:            osg::Geometry* geometry =
osg::createTexturedQuadGeometry(_origin,_width,_height);
./osgcatch/osgcatch.cpp:            osg::Geometry* geometry =
osg::createTexturedQuadGeometry(_origin,_width,_height);
./osgcatch/osgcatch.cpp:            osg::Geometry* geometry =
osg::createTexturedQuadGeometry(_origin,_width,_height);
./osgcatch/osgcatch.cpp:                    osg::Geometry* geometry =
osg::createTexturedQuadGeometry(_origin,_width,_height);
./osgSSBO/osgSSBO.cpp:        geom = osg::createTexturedQuadGeometry(placement,
osg::Vec3(1.0f*scale, 0.0f, 0.0f), osg::Vec3(0.0f, 0.0f,
ratio*1.0f*scale));
./osgSSBO/osgSSBO.cpp:        geom = osg::createTexturedQuadGeometry(placement,
osg::Vec3(ratio*1.0f*scale, 0.0f, 0.0f), osg::Vec3(0.0f, 0.0f,
1.0f*scale));
./osgsampler/osgSampler.cpp:        ((osg::Geode*)geode.get())->addDrawable(
osg::createTexturedQuadGeometry(osg::Vec3(0,0,0),osg::Vec3(1,0,0),osg::Vec3(0,0,1)
));
./osgshadow/osgshadow.cpp:        geode->addDrawable(
osg::createTexturedQuadGeometry( centerBase-widthVec*1.5f-depthVec*1.5f,
./osgimagesequence/osgimagesequence.cpp:    geode->addDrawable(
osg::createTexturedQuadGeometry(osg::Vec3(0.0f,0.0f,0.0),
osg::Vec3(1.0f,0.0f,0.0), osg::Vec3(0.0f,0.0f,1.0f)));
./osgblenddrawbuffers/osgblenddrawbuffers.cpp:        osg::Geometry* geom =
osg::createTexturedQuadGeometry(
./osgmultiplemovies/osgmultiplemovies.cpp:            geo =
osg::createTexturedQuadGeometry(p, osg::Vec3(w, 0, 0), osg::Vec3(0, 0,
desired_height), 0, tex_t, tex_s, 0);
./osgmultiplemovies/osgmultiplemovies.cpp:            geo =
osg::createTexturedQuadGeometry(p, osg::Vec3(w, 0, 0), osg::Vec3(0, 0,
desired_height), 0, 0, tex_s, tex_t);
./osgdeferred/osgdeferred.cpp:    osg::Geometry* geom =
osg::createTexturedQuadGeometry(

-- 
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/CAFN7Y%2BVjKer%2BAfKBgZeiRSOSVUOm57pGwnUVwxWbG5kWR27yxw%40mail.gmail.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20201216/36327154/attachment.html>


More information about the osg-users mailing list