On 9/2/2011 2:11 AM, Alessandro Terenzi wrote:
Hi,
I'd like to set the visualization mode to wireframe on iOS, I use these 
instructions:


Code:
osg::ref_ptr<osg::StateSet>  ss = myModelNode->getOrCreateStateSet();
osg::ref_ptr<osg::PolygonMode>  pm;
pm = new osg::PolygonMode(osg::PolygonMode::FRONT_AND_BACK, 
osg::PolygonMode::LINE);
ss->setAttributeAndModes(pm.get(), osg::StateAttribute::ON | 
osg::StateAttribute::OVERRIDE);




but when the app is running and 'myModelNode' is shown, I keep getting this 
warning:

...
Warning: PolygonMode::apply(State&) - not supported.
...

and, of course, the model is drawn as if it is NOT in wireframe.

Am I doing something wrong? Is really PolygonMode not supported on iOS? If so, 
how can I change to wireframe mode?

I suspect glPolygonMode is not supported in any flavor of OpenGL ES.
http://www.khronos.org/opengles/
...but you should check the spec.

You could "change to wireframe mode" using a switch and a second scene graph that renders your geometry as lines. I don't know of an automated way to create such a scene graph; you might have to write a NodeVisitor to create that for you.
   -Paul

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to