[osg-users] Get all vertices of an OSG Group

Sebastian Messerschmidt sebastian.messerschmidt at gmx.de
Wed Mar 30 12:10:33 PDT 2016


Hi Clement,
> I checked what you suggested but I don't really understand how I can retrieve the respective colors of each points I am looking for.
>
> Do you have any idea how it can be done ?
You need to extend your visitor to capture the StateSet active for your 
drawable. You need to add a osg::Node apply function which 
merges/unmerges the current state until you reach your drawable. Then 
check for the osg::Material StateAttribute of your accumulated state and 
retrieve the diffuse or whatever color your are after (there is some 
getAttribute function on the StateSet)
Take a look at the obj-exporter, it basically does the accumulation and 
material retrieval. In case you have no vertex-colors simply use the 
state-colors or fallback to some default.

Hope that helps
Sebastian
>
> ...
>
> Thank you!
>
> Cheers,
> Clement
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=66675#66675
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




More information about the osg-users mailing list