21 void mapTexCoords(
float u1,
float v1,
float u2,
float v2 );
58 void drawNormals(
float length,
bool bFaceNormals=
false )
const;
70 std::shared_ptr<ofMesh>
mesh;
73 std::vector<ofIndexType>
getIndices(
int startIndex,
int endIndex )
const;
320 int heightSegments,
int capSegments=2,
bool bCapped =
true,
325 int heightSegments,
int capSegments=2,
bool bCapped=
true,
335 void setResolution(
int radiusSegments,
int heightSegments,
int capSegments=2 );
413 int heightSegments,
int capSegments=2,
417 void set(
float radius,
float height,
int radiusSegments,
int heightSegments,
423 void setResolution(
int radiusRes,
int heightRes,
int capRes );
525 int resHeight=2,
int resDepth=2 );
528 void set(
float width,
float height,
float depth,
int resWidth,
529 int resHeight,
int resDepth);
530 void set(
float width,
float height,
float depth );
531 void set(
float size );
546 void setResolution(
int resWidth,
int resHeight,
int resDepth );
A class representing a 3d primitive.
Definition of3dPrimitives.h:12
std::vector< ofIndexType > getIndices(int startIndex, int endIndex) const
Definition of3dPrimitives.cpp:103
void normalizeAndApplySavedTexCoords()
Definition of3dPrimitives.cpp:182
of3dPrimitive & operator=(const of3dPrimitive &mom)
Definition of3dPrimitives.cpp:51
void enableColors()
Definition of3dPrimitives.cpp:129
void disableNormals()
Definition of3dPrimitives.cpp:133
ofMesh * getMeshPtr()
Definition of3dPrimitives.cpp:63
ofMesh normalsMesh
Definition of3dPrimitives.h:71
void drawAxes(float a_size) const
Definition of3dPrimitives.cpp:261
void draw() const
Draw the node as a white cube with xyz axes.
Definition of3dPrimitives.cpp:211
ofMesh & getMesh()
Definition of3dPrimitives.cpp:68
void disableColors()
Definition of3dPrimitives.cpp:141
bool hasNormalsEnabled() const
Definition of3dPrimitives.cpp:116
void drawFaces() const
Definition of3dPrimitives.cpp:201
std::shared_ptr< ofMesh > mesh
Definition of3dPrimitives.h:70
void drawWireframe() const
Definition of3dPrimitives.cpp:196
void enableTextures()
Definition of3dPrimitives.cpp:125
glm::vec4 & getTexCoords()
Definition of3dPrimitives.cpp:88
void drawNormals(float length, bool bFaceNormals=false) const
Definition of3dPrimitives.cpp:216
glm::vec4 texCoords
Definition of3dPrimitives.h:68
void disableTextures()
Definition of3dPrimitives.cpp:137
bool isUsingVbo() const
Definition of3dPrimitives.cpp:283
void enableNormals()
Definition of3dPrimitives.cpp:121
void mapTexCoordsFromTexture(const ofTexture &inTexture)
Definition of3dPrimitives.cpp:164
void mapTexCoords(float u1, float v1, float u2, float v2)
Definition of3dPrimitives.cpp:148
void setUseVbo(bool useVbo)
Definition of3dPrimitives.cpp:268
bool usingVbo
Definition of3dPrimitives.h:69
bool hasScaling() const
Definition of3dPrimitives.cpp:111
void drawVertices() const
Definition of3dPrimitives.cpp:191
of3dPrimitive()
Definition of3dPrimitives.cpp:19
glm::vec4 * getTexCoordsPtr()
Definition of3dPrimitives.cpp:83
virtual ~of3dPrimitive()
Definition of3dPrimitives.cpp:27
The ofBoxPrimitive allows you to create cubes and cuboids.
Definition of3dPrimitives.h:511
void setResolutionHeight(int heightRes)
Definition of3dPrimitives.cpp:1076
glm::vec3 getResolution() const
Definition of3dPrimitives.cpp:1122
void setSideColor(int sideIndex, ofColor color)
Definition of3dPrimitives.cpp:1098
void setDepth(float a_depth)
Definition of3dPrimitives.cpp:1027
~ofBoxPrimitive()
Definition of3dPrimitives.cpp:948
ofBoxPrimitive()
Definition of3dPrimitives.cpp:936
int vertices[6][2]
Definition of3dPrimitives.h:565
glm::vec3 resolution
Definition of3dPrimitives.h:562
std::vector< ofIndexType > getSideIndices(int sideIndex) const
Definition of3dPrimitives.cpp:1039
float getDepth() const
Definition of3dPrimitives.cpp:1137
ofMesh getSideMesh(int sideIndex) const
Definition of3dPrimitives.cpp:1050
BoxSides
Definition of3dPrimitives.h:514
@ SIDE_BOTTOM
Definition of3dPrimitives.h:520
@ SIDE_TOP
Definition of3dPrimitives.h:519
@ SIDE_RIGHT
Definition of3dPrimitives.h:516
@ SIDE_BACK
Definition of3dPrimitives.h:518
@ SIDES_TOTAL
Definition of3dPrimitives.h:521
@ SIDE_FRONT
Definition of3dPrimitives.h:515
@ SIDE_LEFT
Definition of3dPrimitives.h:517
int getResolutionWidth() const
Definition of3dPrimitives.cpp:1107
glm::vec3 size
Definition of3dPrimitives.h:561
void setResolutionDepth(int depthRes)
Definition of3dPrimitives.cpp:1081
int strides[6][2]
Definition of3dPrimitives.h:564
float getWidth() const
Definition of3dPrimitives.cpp:1127
void setHeight(float a_height)
Definition of3dPrimitives.cpp:1021
float getHeight() const
Definition of3dPrimitives.cpp:1132
void setResolutionWidth(int widthRes)
Definition of3dPrimitives.cpp:1071
void setWidth(float a_width)
Definition of3dPrimitives.cpp:1015
int getResolutionHeight() const
Definition of3dPrimitives.cpp:1112
void resizeToTexture(ofTexture &inTexture)
Definition of3dPrimitives.cpp:1033
void setResolution(int res)
Definition of3dPrimitives.cpp:1066
void setMode(ofPrimitiveMode mode)
Definition of3dPrimitives.cpp:1092
glm::vec3 getSize() const
Definition of3dPrimitives.cpp:1142
int getResolutionDepth() const
Definition of3dPrimitives.cpp:1117
The ofConePrimitive allows you to create a 3D cone. Like all primitives it allows you to set the size...
Definition of3dPrimitives.h:408
int getResolutionRadius() const
Definition of3dPrimitives.cpp:901
std::vector< ofIndexType > getConeIndices() const
Definition of3dPrimitives.cpp:857
float getRadius() const
Definition of3dPrimitives.cpp:921
void setMode(ofPrimitiveMode mode)
Definition of3dPrimitives.cpp:822
ofConePrimitive()
Definition of3dPrimitives.cpp:747
void set(float radius, float height, int radiusSegments, int heightSegments, int capSegments=2, ofPrimitiveMode mode=OF_PRIMITIVE_TRIANGLE_STRIP)
Definition of3dPrimitives.cpp:762
int vertices[2][2]
Definition of3dPrimitives.h:466
float height
Definition of3dPrimitives.h:461
void setResolutionCap(int capRes)
Definition of3dPrimitives.cpp:811
float radius
Definition of3dPrimitives.h:460
~ofConePrimitive()
Definition of3dPrimitives.cpp:759
void setResolutionRadius(int radiusRes)
Definition of3dPrimitives.cpp:801
ofMesh getConeMesh() const
Definition of3dPrimitives.cpp:865
void setHeight(float height)
Definition of3dPrimitives.cpp:835
std::vector< ofIndexType > getCapIndices() const
Definition of3dPrimitives.cpp:879
glm::vec3 resolution
Definition of3dPrimitives.h:463
int strides[2][2]
Definition of3dPrimitives.h:465
void setCapColor(ofColor color)
Definition of3dPrimitives.cpp:849
int getResolutionCap() const
Definition of3dPrimitives.cpp:911
void setRadius(float radius)
Definition of3dPrimitives.cpp:829
ofMesh getCapMesh() const
Definition of3dPrimitives.cpp:887
void setTopColor(ofColor color)
Definition of3dPrimitives.cpp:841
void setResolutionHeight(int heightRes)
Definition of3dPrimitives.cpp:806
void setResolution(int radiusRes, int heightRes, int capRes)
Definition of3dPrimitives.cpp:816
float getHeight() const
Definition of3dPrimitives.cpp:926
int getResolutionHeight() const
Definition of3dPrimitives.cpp:906
glm::vec3 getResolution() const
Definition of3dPrimitives.cpp:916
The ofCylinderPrimitive allows you to create an cylinder mesh.
Definition of3dPrimitives.h:316
void setHeight(float height)
Definition of3dPrimitives.cpp:592
ofCylinderPrimitive()
Definition of3dPrimitives.cpp:517
int strides[3][2]
Definition of3dPrimitives.h:361
void setResolutionHeight(int heightRes)
Definition of3dPrimitives.cpp:609
int getResolutionHeight() const
Definition of3dPrimitives.cpp:712
void setCylinderColor(ofColor color)
Definition of3dPrimitives.cpp:640
ofMesh getBottomCapMesh() const
Definition of3dPrimitives.cpp:697
void setBottomCapColor(ofColor color)
Definition of3dPrimitives.cpp:648
void setCapped(bool bCapped)
Definition of3dPrimitives.cpp:598
int getResolutionRadius() const
Definition of3dPrimitives.cpp:707
std::vector< ofIndexType > getCylinderIndices() const
Definition of3dPrimitives.cpp:671
float height
Definition of3dPrimitives.h:359
bool getCapped() const
Definition of3dPrimitives.cpp:737
int getResolutionCap() const
Definition of3dPrimitives.cpp:717
std::vector< ofIndexType > getBottomCapIndices() const
Definition of3dPrimitives.cpp:689
void setRadius(float radius)
Definition of3dPrimitives.cpp:586
std::vector< ofIndexType > getTopCapIndices() const
Definition of3dPrimitives.cpp:656
float radius
Definition of3dPrimitives.h:358
void setTopCapColor(ofColor color)
Definition of3dPrimitives.cpp:632
ofMesh getCylinderMesh() const
Definition of3dPrimitives.cpp:679
float getHeight() const
Definition of3dPrimitives.cpp:727
float getRadius() const
Definition of3dPrimitives.cpp:732
bool bCapped
Definition of3dPrimitives.h:360
void setResolutionCap(int capRes)
Definition of3dPrimitives.cpp:614
~ofCylinderPrimitive()
Definition of3dPrimitives.cpp:529
void set(float radius, float height, int radiusSegments, int heightSegments, int capSegments=2, bool bCapped=true, ofPrimitiveMode mode=OF_PRIMITIVE_TRIANGLE_STRIP)
Definition of3dPrimitives.cpp:532
glm::vec3 getResolution() const
Definition of3dPrimitives.cpp:722
void setResolutionRadius(int radiusRes)
Definition of3dPrimitives.cpp:604
void setMode(ofPrimitiveMode mode)
Definition of3dPrimitives.cpp:625
glm::vec3 resolution
Definition of3dPrimitives.h:363
ofMesh getTopCapMesh() const
Definition of3dPrimitives.cpp:661
void setResolution(int radiusSegments, int heightSegments, int capSegments=2)
Definition of3dPrimitives.cpp:619
int vertices[3][2]
Definition of3dPrimitives.h:362
The ofIcoSpherePrimitive allows you to create an icosphere. An icosphere is a sphere not based on UV ...
Definition of3dPrimitives.h:256
void setResolution(int iterations)
Definition of3dPrimitives.cpp:484
int getResolution() const
Definition of3dPrimitives.cpp:510
ofIcoSpherePrimitive()
Definition of3dPrimitives.cpp:459
float getRadius() const
Definition of3dPrimitives.cpp:505
float radius
Definition of3dPrimitives.h:271
void setRadius(float radius)
Definition of3dPrimitives.cpp:499
int resolution
Definition of3dPrimitives.h:272
void setMode(ofPrimitiveMode mode)
Definition of3dPrimitives.cpp:493
void set(float radius, int res)
Definition of3dPrimitives.cpp:478
~ofIcoSpherePrimitive()
Definition of3dPrimitives.cpp:473
A generic 3d object in space with transformation (position, rotation, scale).
Definition ofNode.h:14
virtual void draw() const
Draw the node as a white cube with xyz axes.
Definition ofNode.cpp:637
The ofPlanePrimitive allows you to create an UV plane. Can be used for example as simple canvas for p...
Definition of3dPrimitives.h:120
int getNumRows() const
Definition of3dPrimitives.cpp:372
float getHeight() const
Definition of3dPrimitives.cpp:387
~ofPlanePrimitive()
Definition of3dPrimitives.cpp:301
void setRows(int rows)
Definition of3dPrimitives.cpp:346
void setHeight(float height)
Definition of3dPrimitives.cpp:329
void resizeToTexture(ofTexture &inTexture, float scale=1.f)
Definition of3dPrimitives.cpp:335
glm::vec2 getResolution() const
Definition of3dPrimitives.cpp:377
glm::vec2 resolution
Definition of3dPrimitives.h:150
void setMode(ofPrimitiveMode mode)
Definition of3dPrimitives.cpp:359
void set(float width, float height, int columns, int rows, ofPrimitiveMode mode=OF_PRIMITIVE_TRIANGLE_STRIP)
Definition of3dPrimitives.cpp:304
void setColumns(int columns)
Definition of3dPrimitives.cpp:341
ofPlanePrimitive()
Definition of3dPrimitives.cpp:289
int getNumColumns() const
Definition of3dPrimitives.cpp:367
float width
Definition of3dPrimitives.h:148
void setWidth(float width)
Definition of3dPrimitives.cpp:323
float height
Definition of3dPrimitives.h:149
void setResolution(int columns, int rows)
Definition of3dPrimitives.cpp:351
float getWidth() const
Definition of3dPrimitives.cpp:382
A class representing a 2D rectangle.
Definition ofRectangle.h:87
The ofSpherePrimitive allows you to create a UV sphere. A UV spherewhich is a sphere based on UV slic...
Definition of3dPrimitives.h:204
int resolution
Definition of3dPrimitives.h:222
void set(float radius, int resolution, ofPrimitiveMode mode=OF_PRIMITIVE_TRIANGLE_STRIP)
Definition of3dPrimitives.cpp:416
float getRadius() const
Definition of3dPrimitives.cpp:447
float radius
Definition of3dPrimitives.h:221
ofSpherePrimitive()
Definition of3dPrimitives.cpp:397
void setResolution(int res)
Definition of3dPrimitives.cpp:426
~ofSpherePrimitive()
Definition of3dPrimitives.cpp:411
void setRadius(float radius)
Definition of3dPrimitives.cpp:441
void setMode(ofPrimitiveMode mode)
Definition of3dPrimitives.cpp:434
int getResolution() const
Definition of3dPrimitives.cpp:452
A wrapper class for an OpenGL texture.
Definition ofTexture.h:253
unsigned int height
Definition ofAppEGLWindow.cpp:125
unsigned int width
Definition ofAppEGLWindow.cpp:124
ofPrimitiveMode
Definition ofGraphicsConstants.h:20
@ OF_PRIMITIVE_TRIANGLE_STRIP
Definition ofGraphicsConstants.h:22
ofPolyRenderMode
Definition ofGraphicsConstants.h:13