class methods
- ofConePrimitive()
- ~ofConePrimitive()
- getCapIndices()
- getCapMesh()
- getConeIndices()
- getConeMesh()
- getHeight()
- getRadius()
- getResolution()
- getResolutionCap()
- getResolutionHeight()
- getResolutionRadius()
- set()
- setCapColor()
- setHeight()
- setMode()
- setRadius()
- setResolution()
- setResolutionCap()
- setResolutionHeight()
- setResolutionRadius()
- setTopColor()
Extends
This class extends others, you can call their methods on an instance of ofConePrimitive too:
The ofConePrimitive allows you to create a 3D cone. Like all primitives it allows you to set the size, draw it, set positions, etc, as a simple example:
void setup()
{
cone.set( coneRadius, coneHeight, coneRadiusSegments, coneHeightSegments );
}
void draw()
{
cone.setPosition(ofGetWidth()*.2, ofGetHeight()*.75, 0);
cone.rotate(spinX, 1.0, 0.0, 0.0);
cone.rotate(spinY, 0, 1.0, 0.0);
// get all the faces from the cpme, handy when you want to copy
// individual vertices or tweak them a little ;)
vector<ofMeshFace> triangles = cone.getMesh().getUniqueFaces();
// now draw
cone.draw();
}
To draw a texture over any primitive, simply bind the ofTexture instance and then draw your primitive:
texture.getTextureReference().bind();
// now draw
cone.draw();
Beware of the cone texture coordinates, they're a little strange.
ofConePrimitive(...)
ofConePrimitive::ofConePrimitive(float radius, float height, int radiusSegments, int heightSegments, int capSegments=2, ofPrimitiveMode mode=OF_PRIMITIVE_TRIANGLE_STRIP)
getCapIndices()
int ofConePrimitive::getCapIndices()
This returns a vector of the indices of vertices that make up the cap (as opposed to the cone indices)
getCapMesh()
ofMesh ofConePrimitive::getCapMesh()
This returns an ofMesh made up of the cap (as opposed to the cone)
getConeIndices()
int ofConePrimitive::getConeIndices()
This returns a vector of the indices of vertices that make up the cone (as opposed to the cap indices)
getConeMesh()
ofMesh ofConePrimitive::getConeMesh()
This returns an ofMesh made up of the cone (as opposed to the cap)
getResolution()
glm::vec3 ofConePrimitive::getResolution()
This returns the resolution of the cone (rather than the cap)
getResolutionCap()
int ofConePrimitive::getResolutionCap()
This returns the resolution of the cap (rather than the cone)
set(...)
void ofConePrimitive::set(float radius, float height, int radiusSegments, int heightSegments, int capSegments=2, ofPrimitiveMode mode=OF_PRIMITIVE_TRIANGLE_STRIP)
Last updated Tuesday, 19 November 2024 17:24:07 UTC - 2537ee49f6d46d5fe98e408849448314fd1f180e
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