class methods
- ofCylinderPrimitive()
- ~ofCylinderPrimitive()
- getBottomCapIndices()
- getBottomCapMesh()
- getCapped()
- getCylinderIndices()
- getCylinderMesh()
- getHeight()
- getRadius()
- getResolution()
- getResolutionCap()
- getResolutionHeight()
- getResolutionRadius()
- getTopCapIndices()
- getTopCapMesh()
- set()
- setBottomCapColor()
- setCapped()
- setCylinderColor()
- setHeight()
- setMode()
- setRadius()
- setResolution()
- setResolutionCap()
- setResolutionHeight()
- setResolutionRadius()
- setTopCapColor()
Extends
This class extends others, you can call their methods on an instance of ofCylinderPrimitive too:
The ofCylinderPrimitive allows you to create an cylinder mesh.
Like all primitives it allows you to set the size, for the cylinder a radius and height, draw it, set positions, etc, as a simple example:
void setup()
{
cylinder.set( cylinderRadius, cylinderHeight );
}
void draw()
{
cylinder.setPosition(ofGetWidth()*.2, ofGetHeight()*.75, 0);
cylinder.rotate(spinX, 1.0, 0.0, 0.0);
cylinder.rotate(spinY, 0, 1.0, 0.0);
// get all the faces from the icoSphere, handy when you want to copy
// individual vertices or tweak them a little ;)
vector<ofMeshFace> triangles = cylinder.getMesh().getUniqueFaces();
// now draw
cylinder.draw();
}
To draw a texture over any primitive, simply bind the ofTexture instance and then draw your primitive:
texture.getTextureReference().bind();
// now draw
cylinder.draw();
ofCylinderPrimitive(...)
ofCylinderPrimitive::ofCylinderPrimitive(float radius, float height, int radiusSegments, int heightSegments, int capSegments=2, bool bCapped=true, ofPrimitiveMode mode=OF_PRIMITIVE_TRIANGLE_STRIP)
set(...)
void ofCylinderPrimitive::set(float radius, float height, int radiusSegments, int heightSegments, int capSegments=2, bool bCapped=true, ofPrimitiveMode mode=OF_PRIMITIVE_TRIANGLE_STRIP)
setResolution(...)
void ofCylinderPrimitive::setResolution(int radiusSegments, int heightSegments, int capSegments=2)
Last updated Saturday, 17 August 2024 20:46:03 UTC - 99bfb4fd7929e233b87b05758efc36f91505592e
If you have any doubt about the usage of this module you can ask in the forum.
If you want to contribute better documentation or start documenting this section you can do so here
If you find anything wrong with this docs you can report any error by opening an issue