Common types

Name

Common types -- The types used everywhere in libgtk3dcanvas.

Synopsis



struct      Gtk3dPoint;
struct      Gtk3dExtents;
struct      Gtk3dRgbColor;
struct      Gtk3dOPoint;
#define     gtk_3dcanvas_transfo_free       (a)

Description

Here are defined some usefull types used everywhere in libgtk3dcanvas.

Details

struct Gtk3dPoint

struct Gtk3dPoint {
        float x;
        float y;
        float z;
};

A simple 3D points, with the associated cartesian coordinates.


struct Gtk3dExtents

struct Gtk3dExtents {
        float xmin;
        float xmax;
        float ymin;
        float ymax;
        float zmin;
        float zmax;
        float avg; /* = ((xmax-xmin)+(ymax-ymin)+(zmax-zmin))/3 */
};

The extents of a 3D object.


struct Gtk3dRgbColor

struct Gtk3dRgbColor {
        float r;
        float g;
        float b;
};

How to describe a color


struct Gtk3dOPoint

struct Gtk3dOPoint {
  /* RGBA color (C4F) */
  float r;
  float g;
  float b;
  float a;
  /* Normal direction (N3F) */
  float nx;
  float ny;
  float nz;
  /* Vertex location (V3F) */
  float x;
  float y;
  float z;
};

A point in a format that OpenGl can represent directly.


gtk_3dcanvas_transfo_free()

#define gtk_3dcanvas_transfo_free(a) g_free(a)

Frees the previously allocated transformation