25static void init_stuff(
void);
30float Octo[6][3] = {{1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0},
31 {-1.0, 0.0, 0.0}, {0.0, -1.0, 0.0}, {0.0, 0.0, -1.0}};
33#define ONORM .57445626
59 {-1.0, -1.0, -1.0}, {1.0, -1.0, -1.0}, {1.0, 1.0, -1.0}, {-1.0, 1.0, -1.0},
60 {-1.0, -1.0, 1.0}, {1.0, -1.0, 1.0}, {1.0, 1.0, 1.0}, {-1.0, 1.0, 1.0}};
64#define UP_NORM Octo[2]
65#define DOWN_NORM Octo[5]
80static void init_stuff(
void)
91 for (i = 0; i < 8; i++) {
178 for (i = 0; i < np; i++) {
190 v2[
Z] =
pts[np - 1][
Z];
221 pdraw = n < np ? n : np;
225 for (i = 0; i <
pdraw; i++) {
237 v2[
Z] =
pts[np - 1][
Z];
681 for (i = 0; i < 6; i++) {
783 if (dx == 0 && dy == 0) {
796 theta = (2 *
Pi) - theta;
807 else if (dx == 0 && dy == 0) {
823 *aspect = *aspect * (180. /
Pi);
824 *slope = *slope * (180. /
Pi);
853 float Ntop[] = {0.0, 0.0, 1.0};
855 base[0][
Z] = base[1][
Z] = base[2][
Z] =
pos2[
Z];
856 v[0][
Z] = v[1][
Z] = v[2][
Z] = v[3][
Z] =
pos2[
Z];
858 base[0][
X] =
pos2[
X] - len / 16.;
859 base[1][
X] =
pos2[
X] + len / 16.;
860 base[0][
Y] = base[1][
Y] =
pos2[
Y] - len / 2.;
862 base[2][
Y] =
pos2[
Y] + .45 * len;
865 v[1][
X] =
pos2[
X] + len / 8.;
866 v[3][
X] =
pos2[
X] - len / 8.;
867 v[0][
Y] =
pos2[
Y] + .2 * len;
868 v[1][
Y] = v[3][
Y] =
pos2[
Y] + .1 * len;
869 v[2][
Y] =
pos2[
Y] + .5 * len;
949 static int first = 1;
961 float base[3],
tip[3], len;
1021 static int first = 1;
1031 G_debug(3,
"gsd_arrow_onsurf");
1036#ifdef DO_SPHERE_BASE
1046 base[
Z] =
tip[
Z] = 0.0;
1072 G_debug(3,
" %f %f -> ", tmp[
X], tmp[
Y]);
1108 float *dir,
float sz)
1110 float slope, aspect;
1112 static int first = 1;
1123 G_debug(3,
" pt: %f,%f,%f dir: %f,%f,%f slope: %f aspect: %f",
1194 float Ntop[] = {0.0, 0.0, 1.0};
1196 base[0][
Z] = base[1][
Z] = base[2][
Z] = base[3][
Z] =
pos2[
Z];
1199 base[0][
X] = base[1][
X] =
pos2[
X] - len / 2.;
1200 base[2][
X] = base[3][
X] =
pos2[
X] + len / 2.;
1202 base[0][
Y] = base[3][
Y] =
pos2[
Y] - len / 16.;
1203 base[1][
Y] = base[2][
Y] =
pos2[
Y] + len / 16.;
1239 else if (len == 5280)
1282 float Ntop[] = {0.0, 0.0, 1.0};
1284 base[0][
Z] = base[1][
Z] = base[2][
Z] = pos[
Z];
1285 base[3][
Z] = base[4][
Z] = base[5][
Z] = pos[
Z];
1288 base[0][
X] = base[2][
X] = base[3][
X] = pos[
X] - len / 2.;
1289 base[1][
X] = base[4][
X] = base[5][
X] = pos[
X] + len / 2.;
1290 base[0][
Y] = base[1][
Y] = pos[
Y];
1291 base[2][
Y] = base[4][
Y] = pos[
Y] - len / 12;
1292 base[3][
Y] = base[5][
Y] = pos[
Y] + len / 12;
1344 static int first = 1;
1380 static int first = 1;
1451float Box[8][3] = {{1.0, 1.0, -1.0}, {-1.0, 1.0, -1.0}, {-1.0, 1.0, 1.0},
1452 {1.0, 1.0, 1.0}, {1.0, -1.0, -1.0}, {-1.0, -1.0, -1.0},
1453 {-1.0, -1.0, 1.0}, {1.0, -1.0, 1.0}};
const char * G_database_unit_name(int)
Get units (localized) name for the current location.
int G_debug(int, const char *,...) __attribute__((format(printf
void gsd_endlist(void)
End list.
int GS_v3norm(float *)
Change v1 so that it is a unit vector (3D)
void GS_v3mult(float *, float)
Multiple vectors.
void gsd_endtfan(void)
ADD.
void gsd_endtmesh(void)
ADD.
void gsd_swaptmesh(void)
ADD.
void gsd_pushmatrix(void)
Push the current matrix stack.
void gsd_backface(int)
ADD.
void GS_set_draw(int)
Sets which buffer to draw to.
void gsd_scale(float, float, float)
Multiply the current matrix by a general scaling matrix.
void gsd_do_scale(int)
Set current scale.
void gsd_bgnqstrip(void)
ADD.
void GS_v3mag(float *, float *)
Magnitude of vector.
void gsd_shademodel(int)
Set shaded model.
float GS_P2distance(float *, float *)
Calculate distance in plane.
void gsd_sphere(float *, float)
ADD.
void gsd_circ(float, float, float)
ADD.
void gsd_bgnpolygon(void)
Delimit the vertices of a primitive or a group of like primitives.
void GS_v3add(float *, float *)
Sum vectors.
void gsd_bgnlist(int, int)
ADD.
int gsd_getshademodel(void)
Get shaded model.
int gsd_makelist(void)
ADD.
void gsd_calllist(int)
ADD.
void GS_v3eq(float *, float *)
Copy vector values.
int gsd_get_txtwidth(const char *, int)
Get text width.
void gsd_endqstrip(void)
ADD.
int gsd_get_txtheight(int size)
Get text height.
Point3 * gsdrape_get_segments(geosurf *, float *, float *, int *)
ADD.
void gsd_color_func(unsigned int)
Set current color.
void gsd_translate(float, float, float)
Multiply the current matrix by a translation matrix.
void gsd_popmatrix(void)
Pop the current matrix stack.
void gsd_flush(void)
Mostly for flushing drawing commands across a network.
void GS_v3cross(float *, float *, float *)
Get the cross product v3 = v1 cross v2.
void gsd_linewidth(short)
Set width of rasterized lines.
void gsd_endline(void)
End line.
void gsd_bgntfan(void)
ADD.
void gsd_disc(float, float, float, float)
ADD.
int GS_v3dir(float *, float *, float *)
Get a normalized direction from v1 to v2, store in v3.
void gsd_bgnline(void)
Begin line.
void GS_done_draw(void)
Draw done, swap buffers.
void gsd_rot(float, char)
ADD.
void gsd_vert_func(float *)
ADD.
void gsd_bgntmesh(void)
ADD.
void gsd_litvert_func2(float *, unsigned long, float *)
ADD.
void gsd_endpolygon(void)
Delimit the vertices of a primitive or a group of like primitives.
void gsd_litvert_func(float *, unsigned long, float *)
Set the current normal vector & specify vertex.
#define G_UNUSED
A macro for an attribute, if attached to a variable, indicating that the variable is not used.
void gsd_3dcursor(float *pt)
Draw 3d cursor.
void gsd_diamond(float *center, unsigned long colr, float siz)
Draws a diamond symbol at the specified center location.
float Box[8][3]
Vertices for box.
void gsd_draw_box(float *center, unsigned long colr, float siz)
Draws a box symbol at the specified center location.
void gsd_3darrow(float *center, unsigned long colr, float siz1, float siz2, float *dir, float sz)
Draw 3d north arrow.
void gsd_line_onsurf(geosurf *gs, float *v1, float *v2)
Line on surface, fix z-values.
void primitive_cylinder(unsigned long colr, int caps)
Primitives only called after transforms.
int gsd_arrow(float *center, unsigned long colr, float siz, float *dir, float sz, geosurf *onsurf)
Draws an arrow.
void gsd_x(geosurf *gs, float *center, int colr, float siz)
Draws a X symbol at the specified center location.
void gsd_drawsphere(float *center, unsigned long colr, float siz)
Draws a sphere at the specified center location.
int gsd_north_arrow(float *pos2, float len, GLuint fontbase, unsigned long arw_clr, unsigned long text_clr)
Draw North Arrow.
float ogverts[8][3]
vertices & normals for octagon in xy plane
void gsd_cube(float *center, unsigned long colr, float siz)
Draws a cube symbol at the specified center location.
int gsd_nline_onsurf(geosurf *gs, float *v1, float *v2, float *pt, int n)
Multiline on surface, fix z-values.
void gsd_diamond_lines(void)
Draw diamond lines.
int gsd_arrow_onsurf(float *base, float *tip, unsigned long colr, int wid, geosurf *gs)
Draw north arrow on surface.
int gsd_scalebar(float *pos2, float len, GLuint fontbase, unsigned long bar_clr, unsigned long text_clr)
Draw Scalebar takes OpenGL coords and size.
float OctoN[8][3]
normals for flat-shaded octahedron
float ogvertsplus[8][3]
vertices for octagon in xy plane, z=1
void dir_to_slope_aspect(float *dir, float *slope, float *aspect, int degrees)
Converts a direction vector to slope and aspect angles.
float Octo[6][3]
vertices for octahedron
int gsd_scalebar_v2(float *pos, float len, GLuint fontbase, unsigned long bar_clr, unsigned long text_clr)
Draw Scalebar (as lines)
void gsd_draw_asterisk(float *center, unsigned long colr, float siz)
Draws an asterisk symbol at the specified center location.
void primitive_cone(unsigned long colr)
Primitives only called after transforms.
void gsd_box(float *center, int colr, float *siz)
Draws a box at the specified center location.
void gsd_draw_gyro(float *center, unsigned long colr, float siz)
Draws a gyro symbol at the specified center location.
void gsd_plus(float *center, int colr, float siz)
Draws a plus sign symbol at the specified center location.
OGSF header file (structures)