Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members Related Pages
sglCylinder Class Reference
#include <sglCylinder.hpp>
Inheritance diagram for sglCylinder::
List of all members.
Public Methods |
| sglCylinder (unsigned int num_slices, unsigned int num_stacks, float height=1.0f, float base_radius=1.0f, float top_radius=1.0f, bool end_caps_flag=true) |
virtual | ~sglCylinder () |
virtual void | printInfo (ostream &ostrm, const char *indent_string) const |
Detailed Description
Create a geometry for a "cylinder." The cylinder is aligned to the Z axis where the base starts at z=0 and height runs along the positive Z direction. This is not a strict cylinder because the base radius can be different from the top radius (a top_radius == 0, results in a cone). The number of slices corresponds to the number of divisions around the circumference, and the number stacks corresponds to the number of divisions along the height dimension (normally 1). A boolean in the constructor argument is used to specify whether or not end caps are to be created (without them this object is a tube).
{\bf Example:}
\begin{verbatim} vector<sglStatelet*> state; state.push_back(new sglLighting(true)); state.push_back(new sglTransparency(true)); state.push_back(new sglCullMode(sglCullMode::eOFF)); sglMaterial *material = new sglMaterial(); material->setAmbient(0.0f, 0.5f, 1.0f); material->setDiffuse(0.0f, 0.5f, 1.0f); material->setAlpha(0.5f); state.push_back(material);
sglCylinder *cylinder = new sglCylinder(20, 1, 4.0f, 2.0f, 0.5f, true); cylinder->setState(0, state, NULL);
sglGeode *geode = new sglGeode; geode->addGeometry(cylinder); \end{verbatim}
Definition at line 68 of file sglCylinder.hpp.
Constructor & Destructor Documentation
sglCylinder::sglCylinder (
|
unsigned int num_slices,
|
|
unsigned int num_stacks,
|
|
float height = 1.0f,
|
|
float base_radius = 1.0f,
|
|
float top_radius = 1.0f,
|
|
bool end_caps_flag = true )
|
|
|
Constructor. -
Parameters:
-
num_slices
|
Number of divisions in the tesselation around the circumference; must be greater than 2. |
num_stacks
|
Number of divisions in the tesselation along the length; must be greater than 0 |
height
|
Length of the cylinder; must be greater than 0. |
base_radius
|
Radius at the base; must be greater than 0. |
top_radius
|
Radius at the top; must be non-negative. |
end_caps_flag
|
If true, the end caps will be created. |
|
sglCylinder::~sglCylinder (
|
) [virtual]
|
|
Member Function Documentation
void sglCylinder::printInfo (
|
ostream & ostrm,
|
|
const char * indent_string ) const [virtual]
|
|
The documentation for this class was generated from the following file:
Generated at Mon Jul 1 18:00:07 2002 for SGL by
1.2.6 written by Dimitri van Heesch,
© 1997-2001