29static void init_stuff(
void);
34float Octo[6][3] = {{1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0},
35 {-1.0, 0.0, 0.0}, {0.0, -1.0, 0.0}, {0.0, 0.0, -1.0}};
37#define ONORM .57445626
63 {-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 {-1.0, -1.0, 1.0}, {1.0, -1.0, 1.0}, {1.0, 1.0, 1.0}, {-1.0, 1.0, 1.0}};
68#define UP_NORM Octo[2]
69#define DOWN_NORM Octo[5]
84static void init_stuff(
void)
95 for (i = 0; i < 8; i++) {
182 for (i = 0; i < np; i++) {
194 v2[
Z] =
pts[np - 1][
Z];
225 pdraw = n < np ? n : np;
229 for (i = 0; i <
pdraw; i++) {
241 v2[
Z] =
pts[np - 1][
Z];
685 for (i = 0; i < 6; i++) {
787 if (dx == 0 && dy == 0) {
800 theta = (2 *
Pi) - theta;
811 else if (dx == 0 && dy == 0) {
827 *aspect = *aspect * (180. /
Pi);
828 *slope = *slope * (180. /
Pi);
857 float Ntop[] = {0.0, 0.0, 1.0};
859 base[0][
Z] = base[1][
Z] = base[2][
Z] =
pos2[
Z];
860 v[0][
Z] = v[1][
Z] = v[2][
Z] = v[3][
Z] =
pos2[
Z];
862 base[0][
X] =
pos2[
X] - len / 16.;
863 base[1][
X] =
pos2[
X] + len / 16.;
864 base[0][
Y] = base[1][
Y] =
pos2[
Y] - len / 2.;
866 base[2][
Y] =
pos2[
Y] + .45 * len;
869 v[1][
X] =
pos2[
X] + len / 8.;
870 v[3][
X] =
pos2[
X] - len / 8.;
871 v[0][
Y] =
pos2[
Y] + .2 * len;
872 v[1][
Y] = v[3][
Y] =
pos2[
Y] + .1 * len;
873 v[2][
Y] =
pos2[
Y] + .5 * len;
953 static int first = 1;
965 float base[3],
tip[3], len;
1025 static int first = 1;
1035 G_debug(3,
"gsd_arrow_onsurf");
1040#ifdef DO_SPHERE_BASE
1050 base[
Z] =
tip[
Z] = 0.0;
1076 G_debug(3,
" %f %f -> ", tmp[
X], tmp[
Y]);
1112 float *dir,
float sz)
1114 float slope, aspect;
1116 static int first = 1;
1127 G_debug(3,
" pt: %f,%f,%f dir: %f,%f,%f slope: %f aspect: %f",
1198 float Ntop[] = {0.0, 0.0, 1.0};
1200 base[0][
Z] = base[1][
Z] = base[2][
Z] = base[3][
Z] =
pos2[
Z];
1203 base[0][
X] = base[1][
X] =
pos2[
X] - len / 2.;
1204 base[2][
X] = base[3][
X] =
pos2[
X] + len / 2.;
1206 base[0][
Y] = base[3][
Y] =
pos2[
Y] - len / 16.;
1207 base[1][
Y] = base[2][
Y] =
pos2[
Y] + len / 16.;
1243 else if (len == 5280)
1286 float Ntop[] = {0.0, 0.0, 1.0};
1288 base[0][
Z] = base[1][
Z] = base[2][
Z] = pos[
Z];
1289 base[3][
Z] = base[4][
Z] = base[5][
Z] = pos[
Z];
1292 base[0][
X] = base[2][
X] = base[3][
X] = pos[
X] - len / 2.;
1293 base[1][
X] = base[4][
X] = base[5][
X] = pos[
X] + len / 2.;
1294 base[0][
Y] = base[1][
Y] = pos[
Y];
1295 base[2][
Y] = base[4][
Y] = pos[
Y] - len / 12;
1296 base[3][
Y] = base[5][
Y] = pos[
Y] + len / 12;
1348 static int first = 1;
1384 static int first = 1;
1455float Box[8][3] = {{1.0, 1.0, -1.0}, {-1.0, 1.0, -1.0}, {-1.0, 1.0, 1.0},
1456 {1.0, 1.0, 1.0}, {1.0, -1.0, -1.0}, {-1.0, -1.0, -1.0},
1457 {-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 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)