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.

float xmin

The minimal X value in this object.

float xmax

The maximal X value in this object.

float ymin

The minimal Y value in this object.

float ymax

The maximal Y value in this object.

float zmin

The minimal Z value in this object.

float zmax

The maximal Z value in this object.

float avg

The center of this object


struct Gtk3dRgbColor

struct Gtk3dRgbColor {

        float r;
        float g;
        float b;
};

How to describe a color

float r

red component of the color, between 0 and 1(full staturation).

float g

green component of the color, between 0 and 1(full staturation).

float b

blue component of the color, between 0 and 1(full staturation).


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.

float r

red component of the color, between 0 and 1(full staturation).

float g

green component of the color, between 0 and 1(full staturation).

float b

blue component of the color, between 0 and 1(full staturation).

float a

alpha of the color, between 0 and 1(full staturation).

float nx

normal along the X axis.

float ny

normal along the Y axis.

float nz

normal along the Z axis.

float x

X coordinate.

float y

Y coordinate.

float z

Z coordinate.


gtk_3dcanvas_transfo_free()

#define gtk_3dcanvas_transfo_free(a) g_free(a)

Frees the previously allocated transformation

a :

a transformation