23#define NTOP 0x00001000
24#define NBOT 0x00000100
25#define NLFT 0x00000010
26#define NRGT 0x00000001
28#define NALL 0x00001111
41 temp[0] = (float)-dz1 * y_res_z2; \
42 temp[1] = (float)dz2 * x_res_z2; \
44 normalizer = sqrt(temp[0] * temp[0] + temp[1] * temp[1] + c_z2_sq); \
47 temp[X] /= normalizer; \
48 temp[Y] /= normalizer; \
49 temp[Z] /= normalizer; \
53static float x_res_z2, y_res_z2;
54static float c_z2, c_z2_sq;
56static unsigned long *norm;
75#ifdef USE_GL_NORMALIZE
77 c_z2_sq = c_z2 * c_z2;
78 x_res_z2 = 2.0 *
gs->xres *
gs->z_exag *
gs->x_mod;
79 y_res_z2 = 2.0 *
gs->yres *
gs->z_exag *
gs->y_mod;
87 c_z2 = 2.0 *
gs->xres *
gs->yres *
gs->x_mod *
gs->y_mod;
88 c_z2_sq = c_z2 * c_z2;
89 x_res_z2 = 2.0 *
gs->xres *
gs->z_exag *
gs->x_mod;
90 y_res_z2 = 2.0 *
gs->yres *
gs->z_exag *
gs->y_mod;
126 if (!
gs->norm_needupdate || !
gs->norms) {
130 gs->norm_needupdate = 0;
141 G_debug(5,
"gs_calc_normals(): id=%d",
gs->gsurf_id);
156 for (row = 1; row <
ycnt; row++) {
158 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)