Hi Mike,

 

Take a look at OpenGL's two-sided lighting support via
glLightModel/GL_LIGHT_MODEL_TWO_SIDE (and exposed in OSG with
osg::LightModel).  I think that's the more elegant solution your looking
for.

 

 

Mike Wittman

[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 

___________________________________________________

Seismic Micro-Technology, Inc.

8584 Katy Freeway, Suite 400 / Houston, Texas 77024

Tel.  +1 (713) 464-6188

Fax. +1 (713) 464-6440

Web:  www.seismicmicro.com
<blocked::blocked::http://www.seismicmicro.com> 

___________________________________________________

Seismic through Simulation with KINGDOM, (RC)2, and SURE! - CONTACT US
TODAY for more information.

 

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michele
Bosi
Sent: Tuesday, August 28, 2007 4:45 PM
To: [email protected]
Subject: [osg-users] Flipping the normals

 

Hello,
I've a relatively easy task to accomplish, that is to render a mesh both
from inside and outside. 
To do this i put the mesh under two different Geodes, in one i set the
front face to "clock wise" on the other I set the front face to "counter
clock wise" turning on the backface culling (or putting the object into
a single Geode turning off the backface culling). The problem is that in
one case (when I render the "interior" of the mesh) the polygons are not
lit since the normals are (of course) not flipped, that is they remain
oriented "outward". 
My question is: how can I flip the normals? should I create two distinct
meshes, one with the original normals and the other with inverted
normals (modifying manually the normal buffers, and doubling the memory
usage) or there is a more elegant way to do that, for example a
node/state like GL_PLEASE_FLIP_MY_NORMALS that can take care of this
task automatically? 
Cheers,
Mike

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

Reply via email to