This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.
#include "of3dGraphics.h"
Functions | |
void | ofSetPlaneResolution (int columns, int rows) |
Set the resolution to use when drawing planes. | |
glm::vec2 | ofGetPlaneResolution () |
Get the current renderer's plane resolution as a vector. | |
void | ofDrawPlane (float x, float y, float width, float height) |
Draw a plane with the current renderer. | |
void | ofDrawPlane (float x, float y, float z, float width, float height) |
Draw a plane with the current renderer. | |
void | ofDrawPlane (const glm::vec3 &position, float width, float height) |
Draw a plane with the current renderer. | |
void | ofDrawPlane (float width, float height) |
Draw a plane with the current renderer at the origin. | |
void | ofSetSphereResolution (int res) |
Set the sphere resolution for the current renderer. | |
int | ofGetSphereResolution () |
Get the sphere resolution used by the current renderer. | |
void | ofDrawSphere (float x, float y, float radius) |
Draw a sphere with the current renderer. | |
void | ofDrawSphere (float x, float y, float z, float radius) |
Draw a sphere with the current renderer. | |
void | ofDrawSphere (const glm::vec3 &position, float radius) |
Draw a sphere with the current renderer. | |
void | ofDrawSphere (float radius) |
Draw a sphere with the current renderer at the coordinate system's origin. | |
void | ofSetIcoSphereResolution (int res) |
Set the icosphere resolution for the current renderer. | |
int | ofGetIcoSphereResolution () |
Get the icosphere resolution used by the current renderer. | |
void | ofDrawIcoSphere (float x, float y, float z, float radius) |
Draw an icosphere with the current renderer. | |
void | ofDrawIcoSphere (float x, float y, float radius) |
Draw an icosphere with the current renderer. | |
void | ofDrawIcoSphere (const glm::vec3 &position, float radius) |
Draw an icosphere with the current renderer. | |
void | ofDrawIcoSphere (float radius) |
Draw an icosphere with the current renderer at the origin. | |
void | ofSetCylinderResolution (int radiusSegments, int heightSegments, int capSegments) |
Set the cylinder resolution for the current renderer. | |
glm::vec3 | ofGetCylinderResolution () |
Get the current renderer's cylinder resolution as a 3D vector. | |
void | ofDrawCylinder (float x, float y, float radius, float height) |
Draw a cylinder with the current renderer. | |
void | ofDrawCylinder (float x, float y, float z, float radius, float height) |
Draw a cylinder with the current renderer. | |
void | ofDrawCylinder (const glm::vec3 &position, float radius, float height) |
Draw a cylinder with the current renderer. | |
void | ofDrawCylinder (float radius, float height) |
Draw a cylinder at the origin using radius and height. | |
void | ofSetConeResolution (int radiusSegments, int heightSegments, int capSegments) |
Set the cone resolution for the current renderer. | |
glm::vec3 | ofGetConeResolution () |
Get the current cone resolution. | |
void | ofDrawCone (float x, float y, float z, float radius, float height) |
Draw a cone with the current renderer. | |
void | ofDrawCone (float x, float y, float radius, float height) |
Draw a cone with the current renderer. | |
void | ofDrawCone (const glm::vec3 &position, float radius, float height) |
Draw a cone with the current renderer. | |
void | ofDrawCone (float radius, float height) |
Draw a cone at the origin using radius and height. | |
void | ofSetBoxResolution (int res) |
Set the resolution the current renderer uses when drawing boxes. | |
void | ofSetBoxResolution (int resWidth, int resHeight, int resDepth) |
Set the current box resolution. | |
glm::vec3 | ofGetBoxResolution () |
Get the current renderer's box resolution as a 3D vector. | |
void | ofDrawBox (float x, float y, float z, float width, float height, float depth) |
Draw a cube with the current renderer. | |
void | ofDrawBox (float x, float y, float z, float size) |
Draw a cube with the current renderer. | |
void | ofDrawBox (const glm::vec3 &position, float width, float height, float depth) |
Draws a cube with the current renderer. | |
void | ofDrawBox (const glm::vec3 &position, float size) |
Draws a cube with the current renderer. | |
void | ofDrawBox (float size) |
Draws a cube with the current renderer, starting from the origin. | |
void | ofDrawBox (float width, float height, float depth) |
Draws a cube with the current renderer, starting from the origin. | |
void | ofSphere (float x, float y, float z, float radius) |
void | ofSphere (float x, float y, float radius) |
void | ofSphere (const glm::vec3 &position, float radius) |
void | ofSphere (float radius) |
void | ofCone (float x, float y, float z, float radius, float height) |
void | ofCone (float x, float y, float radius, float height) |
void | ofCone (const glm::vec3 &position, float radius, float height) |
void | ofCone (float radius, float height) |
void | ofBox (float x, float y, float z, float width, float height, float depth) |
void | ofBox (float x, float y, float z, float size) |
void | ofBox (const glm::vec3 &position, float width, float height, float depth) |
void | ofBox (const glm::vec3 &position, float size) |
void | ofBox (float size) |
void | ofBox (float width, float height, float depth) |
Enumeration Type Documentation
◆ of3dPrimitiveType
enum of3dPrimitiveType |
Function Documentation
◆ ofBox() [1/6]
void ofBox | ( | const glm::vec3 & | position, |
float | size | ||
) |
◆ ofBox() [2/6]
void ofBox | ( | const glm::vec3 & | position, |
float | width, | ||
float | height, | ||
float | depth | ||
) |
◆ ofBox() [3/6]
void ofBox | ( | float | size | ) |
◆ ofBox() [4/6]
void ofBox | ( | float | width, |
float | height, | ||
float | depth | ||
) |
◆ ofBox() [5/6]
void ofBox | ( | float | x, |
float | y, | ||
float | z, | ||
float | size | ||
) |
◆ ofBox() [6/6]
void ofBox | ( | float | x, |
float | y, | ||
float | z, | ||
float | width, | ||
float | height, | ||
float | depth | ||
) |
◆ ofCone() [1/4]
void ofCone | ( | const glm::vec3 & | position, |
float | radius, | ||
float | height | ||
) |
◆ ofCone() [2/4]
void ofCone | ( | float | radius, |
float | height | ||
) |
◆ ofCone() [3/4]
void ofCone | ( | float | x, |
float | y, | ||
float | radius, | ||
float | height | ||
) |
◆ ofCone() [4/4]
void ofCone | ( | float | x, |
float | y, | ||
float | z, | ||
float | radius, | ||
float | height | ||
) |
◆ ofDrawBox() [1/6]
void ofDrawBox | ( | const glm::vec3 & | position, |
float | size | ||
) |
Draws a cube with the current renderer.
A cube is drawn starting from a 3D reference position, with the specified size. The cube is drawn with the current color, e.g. set with ofSetColor(). The cube is drawn filled by default; change this with ofFill();
- Parameters
-
position a glm::vec3 which contains the (x,y,z) coordinates for the cube's reference corner. size The size of the cube.
◆ ofDrawBox() [2/6]
void ofDrawBox | ( | const glm::vec3 & | position, |
float | width, | ||
float | height, | ||
float | depth | ||
) |
Draws a cube with the current renderer.
A box is a rectangular solid: an extruded rectangle. It is drawn starting from a 3D reference coordinate. It has a width (in x), a height (in y), and a depth (in z). The box is drawn with the current color, e.g. set with ofSetColor(). The box is drawn filled by default; change this with ofFill();
- Parameters
-
position a glm::vec3 which contains the (x,y,z) coordinates for the box's reference corner. width The width of the box. height The height of the box. depth The depth of the box.
◆ ofDrawBox() [3/6]
void ofDrawBox | ( | float | size | ) |
Draws a cube with the current renderer, starting from the origin.
The cube is drawn with the current color, e.g. set with ofSetColor(). The cube is drawn filled by default; change this with ofFill();
- Parameters
-
size The size of the cube.
◆ ofDrawBox() [4/6]
void ofDrawBox | ( | float | width, |
float | height, | ||
float | depth | ||
) |
Draws a cube with the current renderer, starting from the origin.
A box is a rectangular solid: an extruded rectangle. It is drawn starting from the origin of the current reference frame. It has a width (in x), a height (in y), and a depth (in z). The box is drawn with the current color, e.g. set with ofSetColor(). The box is drawn filled by default; change this with ofFill();
- Parameters
-
width The width of the box. height The height of the box. depth The depth of the box.
◆ ofDrawBox() [5/6]
void ofDrawBox | ( | float | x, |
float | y, | ||
float | z, | ||
float | size | ||
) |
Draw a cube with the current renderer.
A cube is a rectangular solid bounded by six square faces of equal size. It is also known as a regular hexahedron, a square parallelepiped, an equilateral cuboid and a right rhombohedron. It is a regular square prism in three orientations.
It is drawn starting from a 3D reference coordinate, with the specified size. The cube is drawn with the current color, e.g. set with ofSetColor(). The cube is drawn filled by default; change this with ofFill();
- Parameters
-
x The x-coordinate of the cube's origin. y The y-coordinate of the cube's origin. z The z-coordinate of the cube's origin. size The size of the cube.
◆ ofDrawBox() [6/6]
void ofDrawBox | ( | float | x, |
float | y, | ||
float | z, | ||
float | width, | ||
float | height, | ||
float | depth | ||
) |
Draw a cube with the current renderer.
A box is a rectangular solid: an extruded rectangle. It is drawn starting from a 3D reference coordinate. It has a width (in x), a height (in y), and a depth (in z). The box is drawn with the current color, e.g. set with ofSetColor(). The box is drawn filled by default; change this with ofFill();
- Parameters
-
x The x-coordinate of the box's origin. y The y-coordinate of the box's origin. z The z-coordinate of the box's origin. width The width of the box. height The height of the box. depth The depth of the box.
◆ ofDrawCone() [1/4]
void ofDrawCone | ( | const glm::vec3 & | position, |
float | radius, | ||
float | height | ||
) |
Draw a cone with the current renderer.
Cones are drawn with x, y, and z coordinates representing the centroid of the cone.
- Parameters
-
position The 3D point representing this cone's position. radius The radius to use when drawing this cone's circular footprint. height The height to use when drawing this cone.
◆ ofDrawCone() [2/4]
void ofDrawCone | ( | float | radius, |
float | height | ||
) |
Draw a cone at the origin using radius and height.
This cone will be drawn with its position at the coordinate system's origin (0, 0, 0).
- Parameters
-
radius The radius to use when drawing this cone's circular footprint. height The height to use when drawing this cone.
◆ ofDrawCone() [3/4]
void ofDrawCone | ( | float | x, |
float | y, | ||
float | radius, | ||
float | height | ||
) |
Draw a cone with the current renderer.
Cones are drawn with x, y, and z coordinates representing the centroid of the cylinder. This function draws a cone with a z position property of 0.
- Parameters
-
x The x coordinate to use when drawing this cone. y The y coordinate to use when drawing this cone. radius The radius to use when drawing this cone's circular footprint. height The height to use when drawing this cone.
◆ ofDrawCone() [4/4]
void ofDrawCone | ( | float | x, |
float | y, | ||
float | z, | ||
float | radius, | ||
float | height | ||
) |
Draw a cone with the current renderer.
Cones are drawn with x, y, and z coordinates representing the centroid of the cone.
- Parameters
-
x The x coordinate to use when drawing this cone. y The y coordinate to use when drawing this cone. z The z coordinate to use when drawing this cone. radius The radius to use when drawing this cone's circular footprint. height The height to use when drawing this cone.
◆ ofDrawCylinder() [1/4]
void ofDrawCylinder | ( | const glm::vec3 & | position, |
float | radius, | ||
float | height | ||
) |
Draw a cylinder with the current renderer.
Cyliners are drawn with x, y, and z coordinates representing the centroid of the cylinder.
- Parameters
-
position The 3D point to use as a position coordinate when drawing this cylinder. radius The radius to use when drawing this cylinder's circular footprint. height The height to use when drawing this cylinder.
◆ ofDrawCylinder() [2/4]
void ofDrawCylinder | ( | float | radius, |
float | height | ||
) |
Draw a cylinder at the origin using radius and height.
A cylinder drawn in this way will be positioned at the coordinate system origin (0, 0, 0).
- Parameters
-
radius The radius to use when drawing this cylinder's circular footprint.
◆ ofDrawCylinder() [3/4]
void ofDrawCylinder | ( | float | x, |
float | y, | ||
float | radius, | ||
float | height | ||
) |
Draw a cylinder with the current renderer.
Cyliners are drawn with x, y, and z coordinates representing the centroid of the cylinder. This function doesn't specify a cylinder's z value so it defaults to 0.
- Parameters
-
x The x coordinate to use when drawing this cylinder. y The y coordinate to use when drawing this cylinder. radius The radius to use when drawing this cylinder's circular footprint. height The height to use when drawing this cylinder.
◆ ofDrawCylinder() [4/4]
void ofDrawCylinder | ( | float | x, |
float | y, | ||
float | z, | ||
float | radius, | ||
float | height | ||
) |
Draw a cylinder with the current renderer.
Cylinders are drawn with x, y, and z coordinates representing the centroid of the cylinder.
- Parameters
-
x The x coordinate to use when drawing this cylinder. y The y coordinate to use when drawing this cylinder. z The z coordinate to use when drawing this cylinder. radius The radius to use when drawing this cylinder's circular footprint. height The height to use when drawing this cylinder.
◆ ofDrawIcoSphere() [1/4]
void ofDrawIcoSphere | ( | const glm::vec3 & | position, |
float | radius | ||
) |
Draw an icosphere with the current renderer.
Icospheres are drawn with their position coordinates representing the center of the sphere.
- Parameters
-
position A 3D point specifying the sphere's centroid. radius The radius of the sphere.
◆ ofDrawIcoSphere() [2/4]
void ofDrawIcoSphere | ( | float | radius | ) |
Draw an icosphere with the current renderer at the origin.
Icospheres are drawn with their position coordinates representing the center of the sphere. This function draws a sphere at the coordinate system origin (0, 0, 0).
- Parameters
-
radius The radius of the sphere.
◆ ofDrawIcoSphere() [3/4]
void ofDrawIcoSphere | ( | float | x, |
float | y, | ||
float | radius | ||
) |
Draw an icosphere with the current renderer.
Icospheres are drawn with their x, y, and z coordinates representing the center of the sphere. This function draws the sphere with a default origin z value of 0.
- Parameters
-
x The x coordinate of the sphere's centroid. y The y coordinate of the sphere's centroid. radius The radius of the sphere.
◆ ofDrawIcoSphere() [4/4]
void ofDrawIcoSphere | ( | float | x, |
float | y, | ||
float | z, | ||
float | radius | ||
) |
Draw an icosphere with the current renderer.
Icospheres are drawn with their x, y, and z coordinates representing the center of the sphere.
- Parameters
-
x The x coordinate of the sphere's centroid. y The y coordinate of the sphere's centroid. z The z coordinate of the sphere's centroid. radius The radius of the sphere.
◆ ofDrawPlane() [1/4]
void ofDrawPlane | ( | const glm::vec3 & | position, |
float | width, | ||
float | height | ||
) |
Draw a plane with the current renderer.
Planes are drawn with their position coordinates specifying the center of the plane.
- Parameters
-
position A 3D point specifying the plane's centroid. width The width of the plane. height The height of the plane.
◆ ofDrawPlane() [2/4]
void ofDrawPlane | ( | float | width, |
float | height | ||
) |
Draw a plane with the current renderer at the origin.
- Parameters
-
width The width of the plane. height The height of the plane.
◆ ofDrawPlane() [3/4]
void ofDrawPlane | ( | float | x, |
float | y, | ||
float | width, | ||
float | height | ||
) |
Draw a plane with the current renderer.
Planes are drawn with their x, y, and z coordinates specifying the center of the plane. This function draws the plane with a default origin z value of 0.
- Parameters
-
x The x coordinate of the plane's centroid. y The y coordinate of the plane's centroid. width The width of the plane. height The height of the plane.
◆ ofDrawPlane() [4/4]
void ofDrawPlane | ( | float | x, |
float | y, | ||
float | z, | ||
float | width, | ||
float | height | ||
) |
Draw a plane with the current renderer.
Planes are drawn with their x, y, and z coordinates specifying the center of the plane.
- Parameters
-
x The x coordinate of the plane's centroid. y The y coordinate of the plane's centroid. z The z coordinate of the plane's centroid. width The width of the plane. height The height of the plane.
◆ ofDrawSphere() [1/4]
void ofDrawSphere | ( | const glm::vec3 & | position, |
float | radius | ||
) |
Draw a sphere with the current renderer.
Spheres are drawn with their position representing the center of the sphere.
- Parameters
-
position A 3D point specifying the sphere's centroid. radius The radius of the sphere.
◆ ofDrawSphere() [2/4]
void ofDrawSphere | ( | float | radius | ) |
Draw a sphere with the current renderer at the coordinate system's origin.
Spheres are drawn with their position representing the center of the sphere. This function draws a sphere at the coordinate system origin of 0, 0, 0.
- Parameters
-
radius The radius of the sphere.
◆ ofDrawSphere() [3/4]
void ofDrawSphere | ( | float | x, |
float | y, | ||
float | radius | ||
) |
Draw a sphere with the current renderer.
Spheres are drawn with x, y, and z coordinates representing the center of the sphere. This function draws the sphere with a default origin z value of 0.
- Parameters
-
x The x coordinate of the sphere's centroid. y The y coordinate of the sphere's centroid. radius The radius of the sphere.
◆ ofDrawSphere() [4/4]
void ofDrawSphere | ( | float | x, |
float | y, | ||
float | z, | ||
float | radius | ||
) |
Draw a sphere with the current renderer.
Spheres are drawn with their x, y, and z coordinates representing the center of the sphere.
- Parameters
-
x The x coordinate of the sphere's centroid. y The y coordinate of the sphere's centroid. z The z coordinate of the sphere's centroid. radius The radius of the sphere.
◆ ofGetBoxResolution()
glm::vec3 ofGetBoxResolution | ( | ) |
Get the current renderer's box resolution as a 3D vector.
The returned vector's x, y, and z properties represent the current renderer's resolution width, resolution height, and resolution depth respectively.
- Returns
- This renderer's current box resolution as a 3D vector.
◆ ofGetConeResolution()
glm::vec3 ofGetConeResolution | ( | ) |
Get the current cone resolution.
Allows you to fetch the resolution with which cones are polygonized. Returns a glm::vec3 containing the following data: Encoded as "x": radiusSegments, the number of facets (subdivisions) around the cone's circular footprint. Encoded as "y": heightSegments, the number of subdivisions from the cone's top to bottom. Encoded as "z": capSegments, the number of annular (ring-shaped) subdivisions of the cone's endcap.
- Returns
- A 3D vector containing radiusSegments, heightSegments, capSegments for cone polygonization as x, y, and z properties respectively.
◆ ofGetCylinderResolution()
glm::vec3 ofGetCylinderResolution | ( | ) |
Get the current renderer's cylinder resolution as a 3D vector.
The resulting vector's x, y, and z properties correspond to the radius segments, height segments, and cap segments of the current renderer's cylinder resolution respectively.
- Returns
- A 3D vector representing the current renderer's cylinder resolution.
◆ ofGetIcoSphereResolution()
int ofGetIcoSphereResolution | ( | ) |
Get the icosphere resolution used by the current renderer.
- Returns
- The icosphere resolution used by the current renderer.
◆ ofGetPlaneResolution()
glm::vec2 ofGetPlaneResolution | ( | ) |
Get the current renderer's plane resolution as a vector.
- Returns
- A vector whose x property describes column resolution and y property describes row resolution.
- See also
- ofDrawPlane()
◆ ofGetSphereResolution()
int ofGetSphereResolution | ( | ) |
Get the sphere resolution used by the current renderer.
- Returns
- The sphere resolution used by the current renderer.
◆ ofSetBoxResolution() [1/2]
void ofSetBoxResolution | ( | int | res | ) |
◆ ofSetBoxResolution() [2/2]
void ofSetBoxResolution | ( | int | resWidth, |
int | resHeight, | ||
int | resDepth | ||
) |
Set the current box resolution.
- Parameters
-
resWidth The number of subdivisions to use when drawing box widths. resHeight The number of subdivisions to use when drawing box heights. resDepth The number of subdivisions to use when drawing box depths.
◆ ofSetConeResolution()
void ofSetConeResolution | ( | int | radiusSegments, |
int | heightSegments, | ||
int | capSegments = 2 |
||
) |
Set the cone resolution for the current renderer.
Cones
Allows you to set the polygonization resolution of any cones you subsequently draw with ofDrawCone().
- Parameters
-
radiusSegments The number of facets (subdivisions) around the cone's circular footprint. heightSegments The number of subdivisions from the cone's top to bottom. capSegments The number of annular (ring-shaped) subdivisions of the cone's endcap. Defaults to 2.
◆ ofSetCylinderResolution()
void ofSetCylinderResolution | ( | int | radiusSegments, |
int | heightSegments, | ||
int | capSegments = 2 |
||
) |
Set the cylinder resolution for the current renderer.
Cylinders
- Parameters
-
radiusSegments The number of facets (subdivisions) around the cylinder's circular footprint. A larger number yields a higher resolution. heightSegments The number of horizontal subdivisions from the cylinder's top to bottom. capSegments The number of annular (ring-shaped) subdivisions of the cylinder's endcap. Defaults to 2.
◆ ofSetIcoSphereResolution()
void ofSetIcoSphereResolution | ( | int | res | ) |
Set the icosphere resolution for the current renderer.
A higher resolution will produce a smoother looking sphere at the cost of using more vertices to do so.
- Parameters
-
res The resolution to use when drawing icospheres.
- See also
- ofDrawIcoSphere()
◆ ofSetPlaneResolution()
void ofSetPlaneResolution | ( | int | columns, |
int | rows | ||
) |
Set the resolution to use when drawing planes.
Planes
- Parameters
-
columns The number of columns to use when drawing planes with the current renderer. rows The number of rows to use when drawing planes with the current renderer.
- See also
- ofDrawPlane()
◆ ofSetSphereResolution()
void ofSetSphereResolution | ( | int | res | ) |
Set the sphere resolution for the current renderer.
Spheres
The sphere resolution describes how many facets (cross-sections) will be used when drawing spheres. A higher resolution will produce a smoother looking sphere at the cost of using more vertices to do so.
- Parameters
-
res The resolution to use when drawing spheres.
- See also
- ofDrawSphere()
◆ ofSphere() [1/4]
void ofSphere | ( | const glm::vec3 & | position, |
float | radius | ||
) |
◆ ofSphere() [2/4]
void ofSphere | ( | float | radius | ) |
◆ ofSphere() [3/4]
void ofSphere | ( | float | x, |
float | y, | ||
float | radius | ||
) |
◆ ofSphere() [4/4]
void ofSphere | ( | float | x, |
float | y, | ||
float | z, | ||
float | radius | ||
) |