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 土曜日, 17 8月 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