27#define NTOP 0x00001000
28#define NBOT 0x00000100
29#define NLFT 0x00000010
30#define NRGT 0x00000001
32#define NALL 0x00001111
45 temp[0] = (float)-dz1 * y_res_z2; \
46 temp[1] = (float)dz2 * x_res_z2; \
48 normalizer = sqrt(temp[0] * temp[0] + temp[1] * temp[1] + c_z2_sq); \
51 temp[X] /= normalizer; \
52 temp[Y] /= normalizer; \
53 temp[Z] /= normalizer; \
57static float x_res_z2, y_res_z2;
58static float c_z2, c_z2_sq;
60static unsigned long *norm;
79#ifdef USE_GL_NORMALIZE
81 c_z2_sq = c_z2 * c_z2;
82 x_res_z2 = 2.0 *
gs->xres *
gs->z_exag *
gs->x_mod;
83 y_res_z2 = 2.0 *
gs->yres *
gs->z_exag *
gs->y_mod;
91 c_z2 = 2.0 *
gs->xres *
gs->yres *
gs->x_mod *
gs->y_mod;
92 c_z2_sq = c_z2 * c_z2;
93 x_res_z2 = 2.0 *
gs->xres *
gs->z_exag *
gs->x_mod;
94 y_res_z2 = 2.0 *
gs->yres *
gs->z_exag *
gs->y_mod;
98 slice =
gs->y_mod *
gs->cols;
130 if (!
gs->norm_needupdate || !
gs->norms) {
134 gs->norm_needupdate = 0;
145 G_debug(5,
"gs_calc_normals(): id=%d",
gs->gsurf_id);
160 for (row = 1; row <
ycnt; row++) {
162 G_debug(5,
"gs_calc_normals(): row=%d", row);
int BM_get(struct BM *, int, int)
Gets 'val' from the bitmap.
int G_debug(int, const char *,...) __attribute__((format(printf
int gs_update_curmask(geosurf *)
Update current maps.
typbuff * gs_get_att_typbuff(geosurf *, int, int)
Get attribute data buffer.
void GS_get_scale(float *, float *, float *, int)
Get axis scale.
float GS_global_exag(void)
Get global z-exag value.
#define SET_NORM(i)
This macro is only used in the function calc_norm()
int gs_calc_normals(geosurf *gs)
Calculate normals.
int calc_norm(geosurf *gs, int drow, int dcol, unsigned int neighbors)
Calculate normals.
void init_vars(geosurf *gs)
Init variables.
#define GET_MAPATT(buff, offset, att)
OGSF header file (structures)
#define DRC2OFF(gs, drow, dcol)