Geometric Object RenderingGeometric Object Rendering — Functions for generating easily recognizable 3D geometric objects |
#include <gdk/gdkgl.h>void gdk_gl_draw_cube (gboolean solid,double size);void gdk_gl_draw_sphere (gboolean solid,double radius,int slices,int stacks);void gdk_gl_draw_cone (gboolean solid,double base,double height,int slices,int stacks);void gdk_gl_draw_torus (gboolean solid,double inner_radius,double outer_radius,int nsides,int rings);void gdk_gl_draw_tetrahedron (gboolean solid);void gdk_gl_draw_octahedron (gboolean solid);void gdk_gl_draw_dodecahedron (gboolean solid);void gdk_gl_draw_icosahedron (gboolean solid);void gdk_gl_draw_teapot (gboolean solid,double scale);
void gdk_gl_draw_cube (gboolean solid,double size);
Renders a cube.
The cube is centered at the modeling coordinates origin with sides of
length size
.
|
TRUE if the cube should be solid. |
|
length of cube sides. |
void gdk_gl_draw_sphere (gboolean solid,double radius,int slices,int stacks);
Renders a sphere centered at the modeling coordinates origin of
the specified radius
. The sphere is subdivided around the Z axis into
slices
and along the Z axis into stacks
.
|
TRUE if the sphere should be solid. |
|
the radius of the sphere. |
|
the number of subdivisions around the Z axis (similar to lines of longitude). |
|
the number of subdivisions along the Z axis (similar to lines of latitude). |
void gdk_gl_draw_cone (gboolean solid,double base,double height,int slices,int stacks);
Renders a cone oriented along the Z axis.
The base
of the cone is placed at Z = 0, and the top at Z = height
.
The cone is subdivided around the Z axis into slices
, and along
the Z axis into stacks
.
|
TRUE if the cone should be solid. |
|
the radius of the base of the cone. |
|
the height of the cone. |
|
the number of subdivisions around the Z axis. |
|
the number of subdivisions along the Z axis. |
void gdk_gl_draw_torus (gboolean solid,double inner_radius,double outer_radius,int nsides,int rings);
Renders a torus (doughnut) centered at the modeling coordinates origin whose axis is aligned with the Z axis.
|
TRUE if the torus should be solid. |
|
inner radius of the torus. |
|
outer radius of the torus. |
|
number of sides for each radial section. |
|
number of radial divisions for the torus. |
void gdk_gl_draw_tetrahedron (gboolean solid);
Renders a tetrahedron centered at the modeling coordinates origin with a radius of the square root of 3.
|
TRUE if the tetrahedron should be solid. |
void gdk_gl_draw_octahedron (gboolean solid);
Renders a octahedron centered at the modeling coordinates origin with a radius of 1.0.
|
TRUE if the octahedron should be solid. |
void gdk_gl_draw_dodecahedron (gboolean solid);
Renders a dodecahedron centered at the modeling coordinates origin with a radius of the square root of 3.
|
TRUE if the dodecahedron should be solid. |
void gdk_gl_draw_icosahedron (gboolean solid);
Renders a icosahedron. The icosahedron is centered at the modeling coordinates origin and has a radius of 1.0.
|
TRUE if the icosahedron should be solid. |