[X3D-Public] Does anyone export per-vertex normals?

Michalis Kamburelis michalis.kambi at gmail.com
Fri Feb 11 12:10:47 PST 2011


Dave A wrote:
> If only a crease angle is given, I should, at each vertex, find the
> angle between faces, and if greater than crease, create a 'smooth'
> normals based on surrounding faces. If less (flat), create a NEW mesh,
> removing that face from the rest, and for each of its vertices, set the
> normals same as the face's normal. If flat shaded, might as well create
> a separate mesh for each face, with such normals.

Like Sergey says, creating another mesh sounds excessive. Also, the fact
that a face has a sharp angle at one vertex, doesn't mean that all it's
normals are flat. It may be smooth at other vertexes.

When handling creaseAngle, you just want to create as many normals as
there are coordIndex items (well, ignoring the -1 inside coordIndex).
This allows you to set appropriate normal for each occurrence of a
vertex. Nothing more should be needed. (You may also consider optimized
implementations for creaseAngle = 0 and creaseAngle >= pi cases, this is
what I have in my engine.)

Michalis



More information about the X3D-Public mailing list