[osg-users] different materials for a geometry and highlight

Gianni Ambrosio g.ambrosio+osg at gmail.com
Mon Sep 19 01:20:44 PDT 2016


Hi All,
I've attached an example. Hope this helps to have a reply from somebody (Robert?).

Part of that example is from the OSG 3 Cookbook.
Suppose I have geometry build of triangles. I would like to understand which is the better way to change the color of a selected triangle. And if there is a preferred way to organize the object geometry to facilitate the color change feature.

The user chooses the current color punshing 1,2,3 or 4 key. Then pushing CTRL+LEFTMOUSE on the 3D geometry a triangle is selected. I need to apply the current selected color to the corresponding selected triangle.

Should I use the osgUtil::LineSegmentIntersector::Intersection::indexList value to find the corresponding primitive set the selected triangle belongs to? That seems too much of a hack from my point of view.
Isn't that possible in OSG using primitive sets then I have to split the object geometry into different pieces? (i.e. one Geode for each color so that I can then use the osgUtil::LineSegmentIntersector::Intersection::nodePath instead?)

Thanks for the help.
Gianni

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



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: osgviewer.cpp
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160919/b6f114b1/attachment-0003.asc>


More information about the osg-users mailing list