[osg-users] VRML Normal Issue

Jan Ciger jan.ciger at gmail.com
Thu Mar 26 14:06:54 PDT 2009

Hash: SHA1

Ben Axelrod wrote:

> Can normals per primitive and normals per vertex both be used in a
> single shape?

Not that I am aware of.

> If not, the only way I can imagine having a shape with some smooth
> and some sharp edges is if there is one normal per vertex per face.
> Just like the diagram in the VRML spec shows, if a vertex has 2 faces
> connected to it, it needs 2 normals for a sharp edge, and either 1 or
> 2 for a smooth edge.

That's right, however, if you do not specify the vertex normals
explicitly in the model, the vertex normals are calculated from the
*face normals* using the crease angle. If the face normals have an angle
smaller than the crease angle, the vertex normals will be an average of
the two face normals. For sharp edges you will indeed have to duplicate
the vertices to accommodate the different face normals (as explained
here: http://www.songho.ca/opengl/gl_vertexarray.html)

On the other hand, if you want only sharp edges, you can bind normals
per face and save yourself this whole escapade.

Honestly, it is simpler to export the vertex normals from whatever tool
you are using to produce the data than to fidget with the crease angle -
it is only a kludge to let the program guess the model author's intentions.


Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org


More information about the osg-users mailing list