reference

This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.

of3dUtils.h File Reference
#include "glm/fwd.hpp"

Go to the source code of this file.

Macros

#define GLM_FORCE_CTOR_INIT
 

Functions

void ofDrawAxis (float size)
 Draws x,y,z axes representing the current reference frame.
 
void ofDrawGrid (float stepSize=1.25f, size_t numberOfSteps=8, bool labels=false, bool x=true, bool y=true, bool z=true)
 Draws grid planes representing the current reference frame.
 
void ofDrawGridPlane (float stepSize=1.25f, size_t numberOfSteps=8, bool labels=false)
 Draws the YZ grid plane representing the current reference frame.
 
void ofDrawArrow (const glm::vec3 &start, const glm::vec3 &end, float headSize=0.05f)
 Draws an arrow with the current color.
 
void ofDrawRotationAxes (float radius, float stripWidth=10, int circleRes=60)
 This function renders a set of 3 axis-aligned circular bands, centered at the origin.
 

Macro Definition Documentation

◆ GLM_FORCE_CTOR_INIT

#define GLM_FORCE_CTOR_INIT

Function Documentation

◆ ofDrawArrow()

void ofDrawArrow ( const glm::vec3 &  start,
const glm::vec3 &  end,
float  headSize = 0.05f 
)

Draws an arrow with the current color.

This function draws an arrow from a start (tail) point to an end (head) point, with a conical arrowhead at the end point. The arrow is drawn in the current color (e.g. set with ofSetColor).

ofSetColor(0,0,0);
glm::vec3 arrowTailPoint (0,0,0);
glm::vec3 arrowHeadPoint (100, 150,0);
ofDrawArrow(arrowTailPoint, arrowHeadPoint, 20.0);
void ofDrawArrow(const glm::vec3 &start, const glm::vec3 &end, float headSize)
Draws an arrow with the current color.
Definition of3dUtils.cpp:21
void ofSetColor(const ofColor &color)
Definition ofGraphics.cpp:531
Parameters
startThe start point (tail) of the arrow, expressed as an glm::vec3.
endThe end point (head) of the arrow, expressed as an glm::vec3.
headSizeThe size of the arrowhead.

◆ ofDrawAxis()

void ofDrawAxis ( float  size)

Draws x,y,z axes representing the current reference frame.

This function draws a set of x,y,z axes, which can be helpful for understanding which way is up. There are no unit markings nor arrowheads. Axes are not drawn in the negative directions. Axes are drawn in red (+x), green (+y) and blue (+z), starting from the origin.

Parameters
sizeThe size at which to draw the axes.

◆ ofDrawGrid()

void ofDrawGrid ( float  stepSize = 1.25f,
size_t  numberOfSteps = 8,
bool  labels = false,
bool  x = true,
bool  y = true,
bool  z = true 
)

Draws grid planes representing the current reference frame.

This function draws a set of three double-ended grid planes centered at the origin. Parameters allow each of the grid planes (yz,xz, and xy) to be turned on or off. Optionally, the function can include white numeric labels for grid subdivisions. (Numeric labels are drawn using ofDrawBitmapString internally.)

The yz plane (at x=0) is drawn in red. The xz plane (at y=0) is drawn in green. The xy plane (at z=0) is drawn in blue.

Parameters
stepSizedistance between (parallel) lines on the grid
numberOfStepsnumber of lines to draw on each side of the central axis of the grid. A number of 8 will draw 8 lines on each side of the central axis, plus one line at the central axis.
labelsWhether or not labels are drawn.
xWhether or not the yz plane (at x=0) is drawn.
yWhether or not the xz plane (at y=0) is drawn.
zWhether or not the xy plane (at z=0) is drawn.

◆ ofDrawGridPlane()

void ofDrawGridPlane ( float  stepSize = 1.25f,
size_t  numberOfSteps = 8,
bool  labels = false 
)

Draws the YZ grid plane representing the current reference frame.

This function draws the YZ grid plane, at x=0, in a double-ended manner centered at the origin. Optionally, the function can include white numeric labels for grid subdivisions. (Numeric labels are drawn using ofDrawBitmapString internally.) The grid is drawn with the current color (i.e. set with ofSetColor).

Parameters
stepSizedistance between (parallel) lines on the grid
numberOfStepsnumber of lines to draw on each side of the central axis of the grid. A number of 8 will draw 8 lines on each side of the central axis, plus one line at the central axis.
labelsWhether or not labels are drawn.

◆ ofDrawRotationAxes()

void ofDrawRotationAxes ( float  radius,
float  stripWidth = 10,
int  circleRes = 60 
)

This function renders a set of 3 axis-aligned circular bands, centered at the origin.

Parameters
radiusThe radius of the circular bands.
stripWidthThe width of the circular bands. The default is 10 units.
circleResThe resolution of the circular bands. The default is 60 segments.