[osg-users] VRML Normal Issue

Jan Ciger jan.ciger at gmail.com
Wed Mar 25 13:43:23 PDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ben Axelrod wrote:
> Just to clarify, the way the normals *should* work is sketched in the
> attached image.  Please verify.
> 
> When the angle between 2 faces is sharper than the crease angle,
> there is one normal per face, and when the angle is smoother than the
> crease angle, the normal is averaged.

Correct - what I had in mind was the angle between the normals, not the
faces. The end result would be the same, but this is how the VRML spec
specifies it and it is easier to calculate:

> The creaseAngle field, used by the ElevationGrid, Extrusion, and
> IndexedFaceSet nodes, affects how default normals are generated. If
> the angle between the geometric normals of two adjacent faces is less
> than the crease angle, normals shall be calculated so that the faces
> are smooth-shaded across the edge; otherwise, normals shall be
> calculated so that a lighting discontinuity across the edge is
> produced. For example, a crease angle of .5 radians means that an
> edge between two adjacent polygonal faces will be smooth shaded if
> the geometric normals of the two faces form an angle that is less
> than .5 radians. Otherwise, the faces will appear faceted. Crease
> angles must be greater than or equal to 0.0.

(from:
http://accad.osu.edu/~pgerstma/class/vnv/resources/info/AnnotatedVrmlRef/ch2-26.htm)

However, as I said - right now the loader will average *always*,
regardless of the crease angle. This is even documented in the code:

IndexedFaceSet.cpp, line 241:
> // GvdB: So I ended up computing the smoothing normals myself. Also,
> I might add support for "creaseAngle" if a big need for it rises. //
> However, for now I can perfectly live with the fact that all edges
> are smoothed despite the use of a crease angle.

Regards,

Jan



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

iD8DBQFJypdon11XseNj94gRAkaaAKDfByiriOZH8ntvtFI6hYbA/7VW2QCfX1nX
Bpzs2QlM9aiHrkhk40HJt64=
=KjWi
-----END PGP SIGNATURE-----



More information about the osg-users mailing list