kamikaze

03-29-2002, 01:42 AM

Hello all.

Hope this question is advanced enough to this forum :-).

I'm writing VRML 1.0 viewer (just for fun). Some days ago I ran into this normal smoothing problem: VRML 1.0 specs says that generated normals should be smoothed according to crease angle value. When there are two adjacent faces, and angle between them (==angle between their normals) < crease angle browser should average their respective normals, thereby obtaining smooth, Goraud shaded look. And this is OK if you have no more than two faces sharing same vertex.

Say (and this is very frequent case) that there are more than that, three faces, for example A B and C. They're all sharing one common vector v. Angle between A and B < crease angle. Angle between B and C < crease angle. Angle between A and C > crease angle.

According to specs, I should average A and B normals in vertex v, and also average B and C normals in same vertex.

And that gives me two "concurrent" normals for face B.

I feel that averaging between them is not right solution, am I right?

And, if so, what is _right_?

Another idea I had was calculating something like "supernormal", using all normals in given vertex (no matter how many there are).

I'd calculate it not by simple vector addition, but weighting each normal's influence on "supernomal" (for example according to angular size of face). Then I'd average all normals which have angle between them and "supernormal" < ( crease angle / 2 ). Will it do?

Thanks for help.

Michal

Hope this question is advanced enough to this forum :-).

I'm writing VRML 1.0 viewer (just for fun). Some days ago I ran into this normal smoothing problem: VRML 1.0 specs says that generated normals should be smoothed according to crease angle value. When there are two adjacent faces, and angle between them (==angle between their normals) < crease angle browser should average their respective normals, thereby obtaining smooth, Goraud shaded look. And this is OK if you have no more than two faces sharing same vertex.

Say (and this is very frequent case) that there are more than that, three faces, for example A B and C. They're all sharing one common vector v. Angle between A and B < crease angle. Angle between B and C < crease angle. Angle between A and C > crease angle.

According to specs, I should average A and B normals in vertex v, and also average B and C normals in same vertex.

And that gives me two "concurrent" normals for face B.

I feel that averaging between them is not right solution, am I right?

And, if so, what is _right_?

Another idea I had was calculating something like "supernormal", using all normals in given vertex (no matter how many there are).

I'd calculate it not by simple vector addition, but weighting each normal's influence on "supernomal" (for example according to angular size of face). Then I'd average all normals which have angle between them and "supernormal" < ( crease angle / 2 ). Will it do?

Thanks for help.

Michal