CDraw3D.h File Reference

The following functions provide useful macros to draw complex 3D objects. More...

#include "CMacrosGL.h"
#include <GL/glu.h>

Functions

void cDrawFrame (const double a_scale=1.0, const bool a_modifyMaterialState=true)
 Draw an x-y-z frame.
void cDrawFrame (const double a_axisLengthScale, const double a_axisThicknessScale, const bool a_modifyMaterialState)
 Draw an x-y-z frame.
void cDrawWireBox (const double a_xMin, const double a_xMax, const double a_yMin, const double a_yMax, const double a_zMin, const double a_zMax)
 Draw a box using lines.
void cDrawSphere (const double a_radius, const unsigned int a_numSlices=10, const unsigned int a_numStacks=10)
 Draw a sphere.
void cDrawArrow (const cVector3d &a_arrowStart, const cVector3d &a_arrowTip, const double a_width=0.05)
 Draw a pretty arrow on the z-axis using a cone and a cylinder (using GLUT).


Detailed Description

The following functions provide useful macros to draw complex 3D objects.

In general, they don't set nice colors or modify the OpenGL state, they just draw polygons.


Function Documentation

void cDrawArrow ( const cVector3d a_arrowStart,
const cVector3d a_arrowTip,
const double  a_width 
)

Draw a pretty arrow on the z-axis using a cone and a cylinder (using GLUT).

Draw a pretty arrow on the z-axis using a cone and a cylinder (using GLUT)

Parameters:
a_arrowStart The location of the back of the arrow
a_arrowTip The location of the tip of the arrow
a_width The width (in GL units) of the arrow shaft

void cDrawFrame ( const double  a_scale,
const bool  a_modifyMaterialState 
)

Draw an x-y-z frame.

Draw an X-Y-Z Frame. The red arrow corresponds to the X-Axis, green to the Y-Axis, and blue to the Z-Axis.

The scale parameter determines the size of the arrows.

Parameters:
a_scale Length of each arrow
a_modifyMaterialState If true, this function sets GL to the preferred material state

void cDrawSphere ( const double  a_radius,
const unsigned int  a_numSlices,
const unsigned int  a_numStacks 
)

Draw a sphere.

Render a sphere given a radius.

Parameters:
a_radius Radius of the sphere
a_numSlices Specifies the number of subdivisions around the z axis (similar to lines of longitude)
a_numStacks Specifies the number of subdivisions along the x/y axes (similar to lines of latitude)

void cDrawWireBox ( const double  a_xMin,
const double  a_xMax,
const double  a_yMin,
const double  a_yMax,
const double  a_zMin,
const double  a_zMax 
)

Draw a box using lines.

Draw a line-based box with sides parallel to the x-y-z axes

Parameters:
a_xMin Box side x min position.
a_xMax Box side x max position.
a_yMin Box side y min position.
a_yMax Box side y max position.
a_zMin Box side z min position.
a_zMax Box side z max position.


Generated on Mon Jun 11 09:41:46 2007 for CHAI 3D by  doxygen 1.5.2