[GRASS5] Re: nviz color bug

Markus,

I spent the last couple of days hunting for the color bug when
displaying data with a small Z range.

I was unable to locate the bug, however I believe the problem lies in
the file gs_norms.c in the ogsf library. It is here that the XYZ normal
vectors are calculated for the surface. The normal vectors are then
applied with the opengl function glNormal found in gsd_prim.c. I suspect
that there is a problem with how the normal vectors are calculated and
normalized. With a large Z range the normal XY values span -1 to 1, and
the normal Z values span 0 -1. With lat / long data and data with a low
Z range, the normal Z (temp[Z]) component is not normalized to the 0-1
range but rather a small component of it.

I think it is also in the gs_norms.c file where a "map to sphere"
function should be added for lat / long databases.

If you have any ideas let me know.

--
Bob Covill

Tekmap Consulting
P.O. Box 2016
Fall River, N.S.
B2T 1K6
Canada

E-Mail: bcovill@tekmap.ns.ca
Phone: 902-860-1496
Fax: 902-860-1498