Graphics

Implements core graphic rendering capabilities. More...

Files

file  CDraw3D.h
 Implements OpenGL drawing macros.
 
file  CPrimitives.h
 Implements functions to create basic mesh primitives.
 

Classes

struct  chai3d::cColorf
 This class defines a color using a GLfloat representation for each component. More...
 
struct  chai3d::cColorb
 This class defines a color using a GLubyte representation for each component. More...
 
class  chai3d::cDisplayList
 This class provides support for OpenGL display lists. More...
 
class  chai3d::cFog
 This class implements fog inside the world. More...
 
class  chai3d::cFont
 This class implements support for 2D fonts. More...
 
class  chai3d::cGenericArray
 This class implements an abstract class for describing geometrical elements composed of vertices. More...
 
class  chai3d::cImage
 This class implements a 2D image data structure. More...
 
class  chai3d::cMultiImage
 This class implements an array of 2D image structures. More...
 
class  chai3d::cPointArray
 This class implements an array of 3D points. More...
 
struct  chai3d::cRenderOptions
 This structures provide a containers for storing rendering options that are passed through the scenegraph when rendering the world. (For internal OpenGL use). More...
 
class  chai3d::cSegmentArray
 This class implements an array of 3D segments. More...
 
class  chai3d::cTriangleArray
 This class implements an array of 3D triangles. More...
 
struct  chai3d::cVertexArrayOptions
 This structure manages user options when creating vertex arrays. More...
 
class  chai3d::cVertexArray
 This class implements array of 3D vertices. More...
 
class  chai3d::cVideo
 This class implements support for video files of the OGG/Vorbis format. More...
 

Functions

GLubyte chai3d::cColorFtoB (GLfloat a_value)
 This function converts a color component from GLfloat type to GLubyte type. More...
 
GLfloat chai3d::cColorBtoF (GLubyte a_value)
 This function converts a color component from GLubyte type to GLfloat type. More...
 
void chai3d::cLookAt (const cVector3d &a_eye, const cVector3d &a_at, const cVector3d &a_up)
 This function aligns the current z-axis with a reference frame (similar to function gluLookAt). More...
 
void chai3d::cDrawFrame (const double &a_scale=1.0)
 This function draws an x-y-z frame. More...
 
void chai3d::cDrawFrame (const double &a_axisLengthScale, const double &a_axisThicknessScale)
 This function draws an x-y-z frame. More...
 
void chai3d::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)
 This function draws a box using lines. More...
 
void chai3d::cDrawSphere (const double &a_radius, const unsigned int a_numSlices=10, const unsigned int a_numStacks=10)
 This function draws a sphere. More...
 
void chai3d::cDrawArrow (const cVector3d &a_arrowStart, const cVector3d &a_arrowTip, const double a_width=0.05)
 This function draws an arrow on the z-axis using a cone and a cylinder. More...
 
void chai3d::cDrawSolidTorus (const double &a_innerRadius, const double &a_outerRadius, const int a_sides, const int a_rings)
 This function draws a torus. More...
 
void chai3d::cCreatePlane (cMesh *a_mesh, const double &a_lengthX, const double &a_lengthY, const cVector3d &a_pos=cVector3d(0, 0, 0), const cMatrix3d &a_rot=cIdentity3d(), const cColorf &a_color=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates a plane. More...
 
void chai3d::cCreatePlane2 (cMesh *a_mesh, const double &a_lengthX, const double &a_lengthY, const cVector3d &a_pos=cVector3d(0, 0, 0), const cMatrix3d &a_rot=cIdentity3d(), const cColorf &a_colorTopLeft=cColorf(1.0, 1.0, 1.0, 1.0), const cColorf &a_colorTopRight=cColorf(1.0, 1.0, 1.0, 1.0), const cColorf &a_colorBottomLeft=cColorf(1.0, 1.0, 1.0, 1.0), const cColorf &a_colorBottomRight=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates a plane. More...
 
void chai3d::cCreateMap (cMesh *a_mesh, const double &a_lengthX, const double &a_lengthY, const unsigned int a_numSidesX=10, const unsigned int a_numSidesY=10, const cVector3d &a_pos=cVector3d(0, 0, 0), const cMatrix3d &a_rot=cIdentity3d(), const cColorf &a_color=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates a height map. Similar to a map, but with more triangles. More...
 
void chai3d::cCreateDisk (cMesh *a_mesh, const double &a_radiusX, const double &a_radiusY, const unsigned int a_numSlices=36, const cVector3d &a_pos=cVector3d(0, 0, 0), const cMatrix3d &a_rot=cIdentity3d(), const cColorf &a_color=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates a disk. More...
 
void chai3d::cCreatePanel (cMesh *a_mesh, const double &a_lengthX, const double &a_lengthY, const double &a_radiusCorners=0, const int &a_numSegmentsPerCorner=8, const cVector3d &a_pos=cVector3d(0, 0, 0), const cMatrix3d &a_rot=cIdentity3d(), const cColorf &a_color=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates a panel with optional rounded corners. More...
 
void chai3d::cCreatePanel2 (cMesh *a_mesh, const double &a_lengthX, const double &a_lengthY, const double &a_cornerTopLeftRadius=0, const double &a_cornerTopRightRadius=0, const double &a_cornerBottomLeftRadius=0, const double &a_cornerBottomRightRadius=0, const int &a_numSegmentsPerCorner=8, const cVector3d &a_pos=cVector3d(0, 0, 0), const cMatrix3d &a_rot=cIdentity3d(), const cColorf &a_colorTopLeft=cColorf(0.5f, 0.5f, 0.5f, 1.0f), const cColorf &a_colorTopRight=cColorf(0.5f, 0.5f, 0.5f, 1.0f), const cColorf &a_colorBottomLeft=cColorf(0.3f, 0.3f, 0.3f, 1.0f), const cColorf &a_colorBottomRight=cColorf(0.3f, 0.3f, 0.3f, 1.0f))
 This function creates a panel with optional rounded corners. More...
 
void chai3d::cCreateBox (cMesh *a_mesh, const double &a_lengthX, const double &a_lengthY, const double &a_lengthZ, const cVector3d &a_pos=cVector3d(0, 0, 0), const cMatrix3d &a_rot=cIdentity3d(), const cColorf &a_color=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates a box. More...
 
void chai3d::cCreateTeaPot (cMesh *a_mesh, const double &a_size, const cVector3d &a_pos=cVector3d(0, 0, 0), const cMatrix3d &a_rot=cIdentity3d(), const cColorf &a_color=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates a tea pot. More...
 
void chai3d::cCreateTeaPot (cMesh *a_mesh, const double &a_size, const int &a_quality=4, const cVector3d &a_pos=cVector3d(0, 0, 0), const cMatrix3d &a_rot=cIdentity3d(), const cColorf &a_color=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates a tea pot. More...
 
void chai3d::cCreateCylinder (cMesh *a_mesh, const double &a_height, const double &a_radius, const unsigned int a_numSides=32, const unsigned int a_numHeightSegments=1, const unsigned int a_numRings=1, const bool a_includeTop=true, const bool a_includeBottom=true, const cVector3d &a_pos=cVector3d(0, 0, 0), const cMatrix3d &a_rot=cIdentity3d(), const cColorf &a_color=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates a cylinder. More...
 
void chai3d::cCreatePipe (cMesh *a_mesh, const double &a_height, const double &a_innerRadius, const double &a_outerRadius, const unsigned int a_numSides=32, const unsigned int a_numHeightSegments=1, const cVector3d &a_pos=cVector3d(0, 0, 0), const cMatrix3d &a_rot=cIdentity3d(), const cColorf &a_color=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates a pipe. More...
 
void chai3d::cCreateSphere (cMesh *a_mesh, const double &a_radius, const unsigned int a_numSlices=32, const unsigned int a_numStacks=32, const cVector3d &a_pos=cVector3d(0, 0, 0), const cMatrix3d &a_rot=cIdentity3d(), const cColorf &a_color=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates a sphere. More...
 
void chai3d::cCreateEllipsoid (cMesh *a_mesh, const double &a_radiusX, const double &a_radiusY, const double &a_radiusZ, const unsigned int a_numSlices=32, const unsigned int a_numStacks=32, const cVector3d &a_pos=cVector3d(0, 0, 0), const cMatrix3d &a_rot=cIdentity3d(), const cColorf &a_color=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates an ellipsoid. More...
 
void chai3d::cCreateRing (cMesh *a_mesh, const double &a_innerRadius, const double &a_outerRadius, const unsigned int a_numSides=32, const unsigned int a_numRings=32, const cVector3d &a_pos=cVector3d(0, 0, 0), const cMatrix3d &a_rot=cIdentity3d(), const cColorf &a_color=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates a ring. More...
 
void chai3d::cCreateRingSection (cMesh *a_mesh, const double &a_innerRadius0, const double &a_innerRadius1, const double &a_outerRadius, const double &a_coverageAngleDEG=360, const bool a_includeExtremityFaces=true, const unsigned int a_numSides=32, const unsigned int a_numRings=32, const cVector3d &a_pos=cVector3d(0, 0, 0), const cMatrix3d &a_rot=cIdentity3d(), const cColorf &a_color=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates a ring section. More...
 
void chai3d::cCreateCone (cMesh *a_mesh, const double &a_height, const double &a_radiusBottom, const double &a_radiusTop=0.0, const unsigned int a_numSides=32, const unsigned int a_numHeightSegments=1, const unsigned int a_numRings=1, const bool a_includeBottom=true, const bool a_includeTop=true, const cVector3d &a_pos=cVector3d(0, 0, 0), const cMatrix3d &a_rot=cIdentity3d(), const cColorf &a_color=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates a cone. More...
 
void chai3d::cCreateSquarePyramid (cMesh *a_mesh, const double &a_height, const double &a_baseSize, const bool a_includeBottom=true, const cVector3d &a_pos=cVector3d(0, 0, 0), const cMatrix3d &a_rot=cIdentity3d(), const cColorf &a_color=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates a pyramid. More...
 
void chai3d::cCreateArrow (cMesh *a_mesh, const double &a_length=0.4, const double &a_radiusShaft=0.01, const double &a_lengthTip=0.1, const double &a_radiusTip=0.03, const bool a_includeTipsAtBothExtremities=false, const unsigned int a_numSides=32, const cVector3d &a_direction=cVector3d(0, 0, 1), const cVector3d &a_pos=cVector3d(0, 0, 0), const cColorf &a_color=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates an arrow. More...
 
void chai3d::cCreateCircularArrow (cMesh *a_mesh, const double &a_innerRadius0=0.05, const double &a_innerRadius1=0.05, const double &a_outerRadius=0.3, const double &a_lengthTip=0.2, const double &a_radiusTip=0.1, const double &a_coverageAngleDEG=270, const bool a_includeTipsAtBothExtremities=false, const unsigned int a_numSides=32, const unsigned int a_numRings=32, const cVector3d &a_direction=cVector3d(0, 0, 1), const cVector3d &a_pos=cVector3d(0, 0, 0), const cColorf &a_color=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates an circular arrow. More...
 
void chai3d::cCreateBezierPatch (cMesh *a_mesh, const cVector3d *a_controlPoints, const int a_numDivisions=8, const cVector3d &a_pos=cVector3d(0, 0, 0), const cMatrix3d &a_rot=cIdentity3d(), const cColorf &a_color=cColorf(1.0, 1.0, 1.0, 1.0))
 This function creates a Bezier patch. More...
 

Detailed Description

Function Documentation

GLubyte chai3d::cColorFtoB ( GLfloat  a_value)
inline
Parameters
a_valueComponent expressed in GLfloat type (0.0 - 1.0).
Returns
Converted component in GLubyte type (0x00 - 0xFF).
GLfloat chai3d::cColorBtoF ( GLubyte  a_value)
inline
Parameters
a_valueColor expressed in GLubyte type (0x00 - 0xFF).
Returns
Converted component in GLfloat type (0.0 - 1.0).
void chai3d::cLookAt ( const cVector3d a_eye,
const cVector3d a_at,
const cVector3d a_up 
)

This function aligns the current z-axis with a reference frame in the same way than the OpenGL gluLookAt() function does.

Parameters
a_eyePosition of eye.
a_atLook at position.
a_upUp direction.
void chai3d::cDrawFrame ( const double &  a_scale)

This function draws 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_scaleLength of each arrow
void chai3d::cDrawFrame ( const double &  a_axisLengthScale,
const double &  a_axisThicknessScale 
)

This function draws 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_axisLengthScaleLength of each arrow
a_axisThicknessScaleThickness factor of frame.
void chai3d::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 
)

This function draws a line-based box with sides parallel to the x-y-z axes.

Parameters
a_xMinBox side x min position.
a_xMaxBox side x max position.
a_yMinBox side y min position.
a_yMaxBox side y max position.
a_zMinBox side z min position.
a_zMaxBox side z max position.
void chai3d::cDrawSphere ( const double &  a_radius,
const unsigned int  a_numSlices,
const unsigned int  a_numStacks 
)

This function draws a sphere.

Parameters
a_radiusRadius of the sphere
a_numSlicesSpecifies the number of subdivisions around the z axis (similar to lines of longitude)
a_numStacksSpecifies the number of subdivisions along the x/y axes (similar to lines of latitude)
void chai3d::cDrawArrow ( const cVector3d a_arrowStart,
const cVector3d a_arrowTip,
const double  a_width 
)

This function draws an arrow along the z-axis using a cone and a cylinder.

Parameters
a_arrowStartThe location of the back of the arrow.
a_arrowTipThe location of the tip of the arrow.
a_widthThe width of the arrow shaft.
void chai3d::cDrawSolidTorus ( const double &  a_innerRadius,
const double &  a_outerRadius,
const int  a_sides,
const int  a_rings 
)

This function draws a torus.

Parameters
a_innerRadiusInner radius of the torus.
a_outerRadiusOuter radius of the torus.
a_sidesNumber of sides for each radial section.
a_ringsNumber of radial divisions for the torus.
void chai3d::cCreatePlane ( cMesh a_mesh,
const double &  a_lengthX,
const double &  a_lengthY,
const cVector3d a_pos,
const cMatrix3d a_rot,
const cColorf a_color 
)

This function creates a plane by defining its size along the X and Y axes. Texture coordinates are defined so that the bitmap image maps the entire plane.

Parameters
a_meshMesh object in which primitive is created.
a_lengthXSize along X axis.
a_lengthYSize along Y axis.
a_posPosition where to build the new primitive.
a_rotOrientation of the new primitive.
a_colorColor of vertices.
void chai3d::cCreatePlane2 ( cMesh a_mesh,
const double &  a_lengthX,
const double &  a_lengthY,
const cVector3d a_pos,
const cMatrix3d a_rot,
const cColorf a_colorTopLeft,
const cColorf a_colorTopRight,
const cColorf a_colorBottomLeft,
const cColorf a_colorBottomRight 
)

This function creates a plane by defining its size along the X and Y axes. Texture coordinates are defined so that the bitmap image maps the entire plane.

Parameters
a_meshMesh object in which primitive is created.
a_lengthXSize along X axis.
a_lengthYSize along Y axis.
a_posPosition where to build the new primitive.
a_rotOrientation of the new primitive.
a_colorTopLeftColor of top left vertex.
a_colorTopRightColor of top right vertex.
a_colorBottomLeftColor of bottom left vertex.
a_colorBottomRightColor of bottom right vertex.
void chai3d::cCreateMap ( cMesh a_mesh,
const double &  a_lengthX,
const double &  a_lengthY,
const unsigned int  a_numSidesX,
const unsigned int  a_numSidesY,
const cVector3d a_pos,
const cMatrix3d a_rot,
const cColorf a_color 
)

This function creates a 2D map by defining the size along the X and Y axes, and the number of sides along each axis. For instance, a map containing 3 sides along the X axis and 4 sides along the Y axis will contains: 12 squares composed each of two triangles. The total number of vertices will be equal to 20, respectively (3+1)x(4+1). By modifying the Z component of each vertex you can easily create height maps for instance.Texture coordinates are defined so that the bitmap image covers the entire map.

Parameters
a_meshMesh object in which primitive is created.
a_lengthXSize along X axis.
a_lengthYSize along Y axis.
a_numSidesXNumber of elements along X axis.
a_numSidesYNumber of elements along Y axis.
a_posPosition where to build the new primitive.
a_rotOrientation of the new primitive.
a_colorColor of vertices.
void chai3d::cCreateDisk ( cMesh a_mesh,
const double &  a_radiusX,
const double &  a_radiusY,
const unsigned int  a_numSlices,
const cVector3d a_pos,
const cMatrix3d a_rot,
const cColorf a_color 
)

This function creates a disk by defining its radius properties along axis X and axis Y.

Parameters
a_meshMesh object in which primitive is created.
a_radiusXRadius of sphere along axis X.
a_radiusYRadius of sphere along axis Y.
a_numSlicesSpecifies the number of slices composing the disc.
a_posPosition where to build the new primitive.
a_rotOrientation of the new primitive.
a_colorColor of vertices.
void chai3d::cCreatePanel ( cMesh a_mesh,
const double &  a_lengthX,
const double &  a_lengthY,
const double &  a_radiusCorners,
const int &  a_numSegmentsPerCorner,
const cVector3d a_pos,
const cMatrix3d a_rot,
const cColorf a_color 
)

This function creates a panel with optional rounded corners.

Parameters
a_meshMesh object in which primitive is created.
a_lengthXSize along X axis.
a_lengthYSize along Y axis.
a_radiusCornersRadius of corners.
a_numSegmentsPerCornerNumber of segments per rounded corner.
a_posPosition where to build the new primitive.
a_rotOrientation of the new primitive.
a_colorColor of vertices.
void chai3d::cCreatePanel2 ( cMesh a_mesh,
const double &  a_lengthX,
const double &  a_lengthY,
const double &  a_cornerTopLeftRadius,
const double &  a_cornerTopRightRadius,
const double &  a_cornerBottomLeftRadius,
const double &  a_cornerBottomRightRadius,
const int &  a_numSegmentsPerCorner,
const cVector3d a_pos,
const cMatrix3d a_rot,
const cColorf a_colorTopLeft,
const cColorf a_colorTopRight,
const cColorf a_colorBottomLeft,
const cColorf a_colorBottomRight 
)

This function creates a panel with optional rounded corners.

Parameters
a_meshMesh object in which primitive is created.
a_lengthXSize along X axis.
a_lengthYSize along Y axis.
a_cornerTopLeftRadiusRadius of top left corner.
a_cornerTopRightRadiusRadius of top right corner.
a_cornerBottomLeftRadiusRadius of bottom left corner.
a_cornerTopLeftRadiusRadius of bottom right corner.
a_cornerBottomRightRadiusNumber of segments per rounded corner.
a_numSegmentsPerCornerNumber of segments composing the circular corners.
a_posPosition where to build the new primitive.
a_rotOrientation of the new primitive.
a_colorTopLeftColor of top left vertex.
a_colorTopRightColor of top right vertex.
a_colorBottomLeftColor of bottom left vertex.
a_colorBottomRightColor of bottom right vertex.
void chai3d::cCreateBox ( cMesh a_mesh,
const double &  a_lengthX,
const double &  a_lengthY,
const double &  a_lengthZ,
const cVector3d a_pos,
const cMatrix3d a_rot,
const cColorf a_color 
)

This function creates a box by defining its size along the x, y and z axis. Texture coordinates are defined so that the bitmap image is displayed on each face of the box.

Parameters
a_meshMesh object in which primitive is created.
a_lengthXSize along X axis.
a_lengthYSize along Y axis.
a_lengthZSize along Z axis.
a_posPosition where to build the new primitive.
a_rotOrientation of the new primitive.
a_colorColor of vertices.
void chai3d::cCreateTeaPot ( cMesh a_mesh,
const double &  a_size,
const cVector3d a_pos = cVector3d(0, 0, 0),
const cMatrix3d a_rot = cIdentity3d(),
const cColorf a_color = cColorf(1.0, 1.0, 1.0, 1.0) 
)
void chai3d::cCreateTeaPot ( cMesh a_mesh,
const double &  a_size,
const int &  a_resolution,
const cVector3d a_pos,
const cMatrix3d a_rot,
const cColorf a_color 
)

This function creates a copy of the famous OpenGL tea pot.

Parameters
a_meshMesh object in which primitive is created.
a_sizeSize of the tea pot.
a_resolutionNumber of divisions per patch.
a_posPosition where to build the new primitive.
a_rotOrientation of the new primitive.
a_colorColor of vertices.
void chai3d::cCreateCylinder ( cMesh a_mesh,
const double &  a_height,
const double &  a_radius,
const unsigned int  a_numSides,
const unsigned int  a_numHeightSegments,
const unsigned int  a_numRings,
const bool  a_includeTop,
const bool  a_includeBottom,
const cVector3d a_pos,
const cMatrix3d a_rot,
const cColorf a_color 
)

This function creates a cylinder by defining its radius and height. The user may also decide if the top and bottom discs should be included. Texture coordinates are defined so that the bitmap image wraps around the cylinder. The texture coordinates for the top part of the cylinder are set to (0.0, 0.0, 0.0). The texture coordinates for the bottom part of the cylinder are set to (1.0, 1.0, 0.0). When texture is enabled, the colors defining the top and bottoms sections of the cylinder are defined by both texels.

Parameters
a_meshMesh object in which primitive is created.
a_heightHeight of the cylinder.
a_radiusRadius of the cylinder.
a_numSidesNumber of sides composing the cylinder.
a_numHeightSegmentsNumber of segments along the cylinder axis.
a_numRingsNumber of rings that compose the top and bottom disks.
a_includeTopIf true, then the top disc is included.
a_includeBottomIf true, then the bottom disc is included.
a_posPosition where to build the new primitive.
a_rotOrientation of the new primitive.
a_colorColor of vertices.
void chai3d::cCreatePipe ( cMesh a_mesh,
const double &  a_height,
const double &  a_innerRadius,
const double &  a_outerRadius,
const unsigned int  a_numSides,
const unsigned int  a_numHeightSegments,
const cVector3d a_pos,
const cMatrix3d a_rot,
const cColorf a_color 
)

This function creates a pipe by defining a height, inner radius and outer radius.

Parameters
a_meshMesh object in which primitive is created.
a_heightHeight of the pipe.
a_innerRadiusInner radius of the pipe.
a_outerRadiusOuter radius of the pipe.
a_numSidesNumber of sides composing the pipe.
a_numHeightSegmentsNumber of segments along the cylinder axis.
a_posPosition where to build the new primitive.
a_rotOrientation of the new primitive.
a_colorColor of vertices.
void chai3d::cCreateSphere ( cMesh a_mesh,
const double &  a_radius,
const unsigned int  a_numSlices,
const unsigned int  a_numStacks,
const cVector3d a_pos,
const cMatrix3d a_rot,
const cColorf a_color 
)

This function creates sphere by defining its radius.

Parameters
a_meshMesh object in which primitive is created.
a_radiusRadius of sphere.
a_numSlicesSpecifies the number of subdivisions around the z axis (similar to lines of longitude).
a_numStacksSpecifies the number of subdivisions along the z axis (similar to lines of latitude).
a_posPosition where to build the new primitive.
a_rotOrientation of the new primitive.
a_colorColor of vertices.
void chai3d::cCreateEllipsoid ( cMesh a_mesh,
const double &  a_radiusX,
const double &  a_radiusY,
const double &  a_radiusZ,
const unsigned int  a_numSlices,
const unsigned int  a_numStacks,
const cVector3d a_pos,
const cMatrix3d a_rot,
const cColorf a_color 
)

This function creates an ellipsoid by defining the radius properties along each axis X, Y and Z.

Parameters
a_meshMesh object in which primitive is created.
a_radiusXRadius along X axis.
a_radiusYRadius along Y axis.
a_radiusZRadius along Z axis.
a_numSlicesSpecifies the number of subdivisions around the z axis (similar to lines of longitude).
a_numStacksSpecifies the number of subdivisions along the z axis (similar to lines of latitude).
a_posPosition where to build the new primitive.
a_rotOrientation of the new primitive.
a_colorColor of vertices.
void chai3d::cCreateRing ( cMesh a_mesh,
const double &  a_innerRadius,
const double &  a_outerRadius,
const unsigned int  a_numSides,
const unsigned int  a_numRings,
const cVector3d a_pos,
const cMatrix3d a_rot,
const cColorf a_color 
)

This function creates a torus by defining the inner and outer radius values.

Parameters
a_meshMesh object in which primitive is created.
a_innerRadiusInner radius of the torus.
a_outerRadiusOuter radius of the torus.
a_numSidesNumber of sides for each radial section.
a_numRingsNumber of radial divisions for the torus.
a_posPosition where to build the new primitive.
a_rotOrientation of the new primitive.
a_colorColor of vertices.
void chai3d::cCreateRingSection ( cMesh a_mesh,
const double &  a_innerRadius0,
const double &  a_innerRadius1,
const double &  a_outerRadius,
const double &  a_coverageAngleDEG,
const bool  a_includeExtremityFaces,
const unsigned int  a_numSides,
const unsigned int  a_numRings,
const cVector3d a_pos,
const cMatrix3d a_rot,
const cColorf a_color 
)

This function creates a torus by defining the inner and outer radius values.

Parameters
a_meshMesh object in which primitive is created.
a_innerRadius0Inner radius of the ring at the beginning extremity.
a_innerRadius1Inner radius of the ring at the end extremity.
a_outerRadiusOuter radius of the torus.
a_coverageAngleDEGCoverage angle in degrees (from 0 to 360).
a_includeExtremityFacesInclude flat surfaces at extremities of ring section.
a_numSidesNumber of sides for each radial section.
a_numRingsNumber of radial divisions for the torus.
a_posPosition where to build the new primitive.
a_rotOrientation of the new primitive.
a_colorColor of vertices.
void chai3d::cCreateCone ( cMesh a_mesh,
const double &  a_height,
const double &  a_radiusBottom,
const double &  a_radiusTop,
const unsigned int  a_numSides,
const unsigned int  a_numHeightSegments,
const unsigned int  a_numRings,
const bool  a_includeBottom,
const bool  a_includeTop,
const cVector3d a_pos,
const cMatrix3d a_rot,
const cColorf a_color 
)

This function creates a cone by defining its height and bottom radius. By defining a top radius larger than zero, it is possible to create a truncated cone. Top and bottom parts can also be included or not.

Parameters
a_meshMesh object in which primitive is created.
a_heightHeight of cone.
a_radiusBottomBottom radius of cone.
a_radiusTopTop radius of cone. Apply 0 value for non truncated cone.
a_numSidesNumber of sides composing the cone.
a_numHeightSegmentsNumber of segments along the cone axis.
a_numRingsNumber of rings that compose the top and bottom disks.
a_includeTopIf true, then the top disc is included. (truncated cone)
a_includeBottomIf true, then the bottom disc is included.
a_posPosition where to build the new primitive.
a_rotOrientation of the new primitive.
a_colorColor of vertices.
void chai3d::cCreateSquarePyramid ( cMesh a_mesh,
const double &  a_height,
const double &  a_baseSize,
const bool  a_includeBottom,
const cVector3d a_pos,
const cMatrix3d a_rot,
const cColorf a_color 
)

This function creates a square pyramid.

Parameters
a_meshMesh object in which primitive is created.
a_heightHeight of square pyramid.
a_baseSizeSize of a base of the pyramid.
a_includeBottomIf true, then the bottom (square) of the pyramid is included.
a_posPosition where to build the new primitive.
a_rotOrientation of the new primitive.
a_colorColor of vertices.
void chai3d::cCreateArrow ( cMesh a_mesh,
const double &  a_length,
const double &  a_radiusShaft,
const double &  a_lengthTip,
const double &  a_radiusTip,
const bool  a_includeTipsAtBothExtremities,
const unsigned int  a_numSides,
const cVector3d a_direction,
const cVector3d a_pos,
const cColorf a_color 
)

This function creates a linear arrow.

Parameters
a_meshMesh object in which primitive is created.
a_lengthLength of arrow.
a_radiusShaftRadius of arrow shaft.
a_lengthTipLength or arrow tip.
a_radiusTipRadius of arrow tip.
a_includeTipsAtBothExtremitiesInclude tip at both extremities of arrow.
a_numSidesNumber of sides for each radial section.
a_directionDirection of arrow.
a_posPosition where to build the new primitive.
a_colorColor of vertices.
void chai3d::cCreateCircularArrow ( cMesh a_mesh,
const double &  a_innerRadius0,
const double &  a_innerRadius1,
const double &  a_outerRadius,
const double &  a_lengthTip,
const double &  a_radiusTip,
const double &  a_coverageAngleDeg,
const bool  a_includeTipsAtBothExtremities,
const unsigned int  a_numSides,
const unsigned int  a_numRings,
const cVector3d a_direction,
const cVector3d a_pos,
const cColorf a_color 
)

This function creates a circular arrow.

Parameters
a_meshMesh object in which primitive is created.
a_innerRadius0Length of arrow.
a_innerRadius1Radius of arrow shaft.
a_outerRadiusRadius of arrow shaft.
a_lengthTipLength or arrow tip.
a_radiusTipRadius of arrow tip.
a_coverageAngleDegCoverage angle of the arrow (0-360 degrees)
a_includeTipsAtBothExtremitiesInclude tip at both extremities of arrow.
a_numSidesNumber of sides for each radial section.
a_numRingsNumber of radial divisions for the circular shaft.
a_directionDirection of circular arrow plane.
a_posPosition where to build the new primitive.
a_colorColor of vertices.
void chai3d::cCreateBezierPatch ( cMesh a_mesh,
const cVector3d a_controlPoints,
const int  a_numDivisions,
const cVector3d a_pos,
const cMatrix3d a_rot,
const cColorf a_color 
)

This function creates a Bezier patch from a set of control points.

Parameters
a_meshMesh object in which primitive is created.
a_controlPointsBezier control points (16).
a_numDivisionsNumber of division along each side of the patch.
a_posPosition where to build the new primitive.
a_rotOrientation of the new primitive.
a_colorColor of vertices.