primitive

primitive — 3D primitive generation functions

Synopsis




G3DObject*  g3d_primitive_cube              (gfloat width,
                                             gfloat height,
                                             gfloat depth,
                                             G3DMaterial *material);
G3DObject*  g3d_primitive_cylinder          (gfloat radius,
                                             gfloat height,
                                             guint32 sides,
                                             gboolean top,
                                             gboolean bottom,
                                             G3DMaterial *material);
G3DObject*  g3d_primitive_tube              (gfloat r_in,
                                             gfloat r_out,
                                             gfloat height,
                                             guint32 sides,
                                             gboolean top,
                                             gboolean bottom,
                                             G3DMaterial *material);
G3DObject*  g3d_primitive_sphere            (gfloat radius,
                                             guint32 vseg,
                                             guint32 hseg,
                                             G3DMaterial *material);

Description

Details

g3d_primitive_cube ()

G3DObject*  g3d_primitive_cube              (gfloat width,
                                             gfloat height,
                                             gfloat depth,
                                             G3DMaterial *material);

Generates an object containing a cube.

width : the width of the cube
height : the height of the cube
depth : the depth of the cube
material : the material to use for all faces
Returns : the cube object

g3d_primitive_cylinder ()

G3DObject*  g3d_primitive_cylinder          (gfloat radius,
                                             gfloat height,
                                             guint32 sides,
                                             gboolean top,
                                             gboolean bottom,
                                             G3DMaterial *material);

Generates an object containing a cylinder.

radius : the radius of the cylinder
height : the height of the side faces
sides : number of side faces (number of circle segments)
top : add top faces
bottom : add bottom faces
material : material to use for faces
Returns : cylinder object

g3d_primitive_tube ()

G3DObject*  g3d_primitive_tube              (gfloat r_in,
                                             gfloat r_out,
                                             gfloat height,
                                             guint32 sides,
                                             gboolean top,
                                             gboolean bottom,
                                             G3DMaterial *material);

Generates an object containing a tube (a cylinder with a hole).

r_in : inner radius
r_out : outer radius
height : the height of the side faces
sides : number of side faces (number of circle segments)
top : add top faces
bottom : add bottom faces
material : material to use for faces
Returns : tube object

g3d_primitive_sphere ()

G3DObject*  g3d_primitive_sphere            (gfloat radius,
                                             guint32 vseg,
                                             guint32 hseg,
                                             G3DMaterial *material);

Generates an object containing a sphere.

radius : radius
vseg : number of vertical segments
hseg : number of horizontal segments
material : material to use for faces
Returns : sphere object