ofBoxPrimitive
The ofBoxPrimitive allows you to create cubes and cuboids.
Like other primitives, it allows you to set its dimensions and position, draw it, etc. As a simple example:
void setup()
{
box.set( boxSize );
// or
// box.set( boxHeight, boxWidth, boxDepth );
}
void draw()
{
box.setPosition(ofGetWidth()*.2, ofGetHeight()*.75, 0);
box.rotate(spinX, 1.0, 0.0, 0.0);
box.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
getDepth( )
float getDepth()getHeight( )
float getHeight()getResolution( )
glm::vec3 getResolution()getResolutionDepth( )
int getResolutionDepth()getResolutionHeight( )
int getResolutionHeight()getResolutionWidth( )
int getResolutionWidth()getSideIndices( )
int getSideIndices()getSideMesh( ... )
ofMesh getSideMesh(int sideIndex)getSize( )
glm::vec3 getSize()getWidth( )
float getWidth()ofBoxPrimitive( )
ofBoxPrimitive()ofBoxPrimitive( ... )
ofBoxPrimitive(float width, float height, float depth, int resWidth=2, int resHeight=2, int resDepth=2)resizeToTexture( ... )
void resizeToTexture(ofTexture &inTexture)set( ... )
void set(float size)set( ... )
void set(float width, float height, float depth)set( ... )
void set(float width, float height, float depth, int resWidth, int resHeight, int resDepth)setDepth( ... )
void setDepth(float a_depth)setHeight( ... )
void setHeight(float a_height)setMode( ... )
void setMode(ofPrimitiveMode mode)setResolution( ... )
void setResolution(int res)setResolution( ... )
void setResolution(int resWidth, int resHeight, int resDepth)setResolutionDepth( ... )
void setResolutionDepth(int depthRes)setResolutionHeight( ... )
void setResolutionHeight(int heightRes)setResolutionWidth( ... )
void setResolutionWidth(int widthRes)setSideColor( ... )
void setSideColor(int sideIndex, ofColor color)setWidth( ... )
void setWidth(float a_width)~ofBoxPrimitive( )
~ofBoxPrimitive()