[osg-users] Constructing normals for osg::DrawElements

John Donovan john.donovan at embryonicstudios.com
Tue Sep 18 02:37:53 PDT 2007


Cervantes Pintor Pedro wrote:
> Hi,
> 
> 
> I'm constructing a geometric object by hand. The way I'm doing it, is vertex by 
> vertex and then polygon by polygon.
> 


Hi Cervantes,
normals are really just a property of vertices, not faces. The way to get flat
faces with the fixed-function pipeline is to duplicate the vertices and give
them different normals.
If you're using (or prepared to use) vertex shaders, you could attach your
second normals to another stream, and write a vertex shader to choose the right
normal. How you do this is application dependent, but to emulate the standard
lighting calculations is well documented.

-J


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________



More information about the osg-users mailing list