class methods
Extends
This class extends others, you can call their methods on an instance of ofIcoSpherePrimitive too:
The ofIcoSpherePrimitive allows you to create an icosphere, which is a sphere not based on UV slices like the ofSpherePrimitive, but rather faces. Like this:
Like all primitives it allows you to set the radius, draw it, set positions, etc.
void setup()
{
icoSphere.setRadius( width );
}
void draw()
{
icoSphere.setPosition(ofGetWidth()*.2, ofGetHeight()*.75, 0);
icoSphere.rotate(spinX, 1.0, 0.0, 0.0);
icoSphere.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 = icoSphere.getMesh().getUniqueFaces();
// now draw
icoSphere.draw();
}
Last updated 화요일, 19 11월 2024 17:24:02 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