+ if (marker->ortho) {
+ gdouble px, py, pz;
+ grits_viewer_project(GRITS_VIEWER(opengl),
+ point->lat, point->lon, point->elev,
+ &px, &py, &pz);
+
+ gint win_width = GTK_WIDGET(opengl)->allocation.width;
+ gint win_height = GTK_WIDGET(opengl)->allocation.height;
+ if (pz > 1)
+ return;
+
+ glMatrixMode(GL_PROJECTION); glLoadIdentity();
+ glMatrixMode(GL_MODELVIEW); glLoadIdentity();
+ glOrtho(0, win_width, win_height, 0, 1, -1);
+ glTranslated(px, win_height-py, 0);
+ glRotatef(marker->angle, 0, 0, -1);
+ glTranslated(-marker->xoff, -marker->yoff, 0);
+ } else {
+ gdouble scale, eye[3], pos[3] =
+ {point->lat, point->lon, point->elev};
+ grits_viewer_get_location(GRITS_VIEWER(opengl),
+ &eye[0], &eye[1], &eye[2]);
+ lle2xyz(eye[0], eye[1], eye[2],
+ &eye[0], &eye[1], &eye[2]);
+ lle2xyz(pos[0], pos[1], pos[2],
+ &pos[0], &pos[1], &pos[2]);
+ scale = MPPX(distd(eye, pos));
+
+ glRotatef(marker->angle, 0, 0, -1);
+ glRotatef(180, 1, 0, 0);
+ glScalef(scale, scale, 1);
+ glTranslated(-marker->xoff, -marker->yoff, 0);
+ }
+
+ //g_debug("GritsOpenGL: draw_marker - %s pz=%f ", marker->label, pz);