How to pick and highlight a modelnode with the mouse?

classic Classic list List threaded Threaded
3 messages Options
vigos lee vigos lee
Reply | Threaded
Open this post in threaded view
|

How to pick and highlight a modelnode with the mouse?

Hi,
I now use osg::osgUtil::Intersection to select the model, and it works.
But something went wrong when I tried to highlight the model.
I tried to use osg::osgFX::Outline, but it didn't work well.
I refer to the method here.
I can changes the color of the model,but I don't know how to get the original color of the model.
What I want to achieve is to let the model change color temporarily when I select it.
This is probably an OSG problem, but I wonder if OSGEarh has a relevant method?
I'm sorry if it bothers you.
Thanks!
vigos
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: How to pick and highlight a modelnode with the mouse?

Vigos,
Remember that if you change members of the ColorArray, you have to call array->dirty() in order for it to update on the GPU.
Glenn Waldron / Pelican Mapping
vigos lee vigos lee
Reply | Threaded
Open this post in threaded view
|

Re: How to pick and highlight a modelnode with the mouse?

Thank you for your help!
vigos