- lle2xyz(self->lat, self->lon, self->elev,
- &self->x, &self->y, &self->z);
-}
-
-void gis_point_set_xyz(GisPoint *self, gdouble x, gdouble y, gdouble z)
-{
- self->x = x;
- self->y = y;
- self->z = z;
-}
-
-void gis_point_set_coords(GisPoint *self, gdouble x, gdouble y)
-{
- self->cx = x;
- self->cy = y;
-}
-
-void gis_point_project(GisPoint *self, GisProjection *proj)
-{
- gluProject(self->x, self->y, self->z,
- proj->model, proj->proj, proj->view,
- &self->px, &self->py, &self->pz);
-}
-
-GisPoint *gis_point_ref(GisPoint *self)
-{
- self->refs++;
- return self;
-}
-
-void gis_point_unref(GisPoint *self)
-{
- self->refs--;
- if (self->refs <= 0)
- g_free(self);
-}
-
-
-/* GisTriangle */
-GisTriangle *gis_triangle_new(GisPoint *a, GisPoint *b, GisPoint *c, guint tex)
-{
- GisTriangle *self = g_new0(GisTriangle, 1);
- GIS_OBJECT(self)->type = GIS_TYPE_TRIANGLE;
- gis_point_set_xyz(&GIS_OBJECT(self)->center,
- (a->x + b->x + c->x)/3,
- (a->y + b->y + c->y)/3,
- (a->z + b->z + c->z)/3);
- self->verts[0] = gis_point_ref(a);
- self->verts[1] = gis_point_ref(b);
- self->verts[2] = gis_point_ref(c);
- self->tex = tex;
- return self;