This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.
Macros | |
#define | CALLBACK |
Functions | |
void | ofSetCurrentRenderer (shared_ptr< ofBaseRenderer > renderer, bool setDefaults) |
void | ofPushView () |
Stores the current viewport and matrix settings. | |
void | ofPopView () |
Restores the viewport and matrix settings set by ofPushView() | |
void | ofViewport (ofRectangle viewport) |
Setup the drawing viewport. | |
void | ofViewport (float x, float y, float width, float height, bool invertY) |
Setup the drawing viewport. | |
ofRectangle | ofGetCurrentViewport () |
Get the position and size of the current viewport. | |
ofRectangle | ofGetNativeViewport () |
Get the position and size of the native viewport. | |
int | ofGetViewportWidth () |
Get the width of the current viewport. | |
int | ofGetViewportHeight () |
Get the height of the current viewport. | |
int | ofOrientationToDegrees (ofOrientation orientation) |
bool | ofIsVFlipped () |
Get if view is flipped vertically. | |
void | ofSetCoordHandedness (ofHandednessType handedness) |
ofHandednessType | ofGetCoordHandedness () |
void | ofSetupScreenPerspective (float width, float height, float fov, float nearDist, float farDist) |
void | ofSetupScreenOrtho (float width, float height, float nearDist, float farDist) |
void | ofSetupGraphicDefaults () |
Resets openGL screen coordinates and values back to OF defaults. | |
void | ofSetupScreen () |
void | ofPushMatrix () |
Saves the current coordinate system allowing users to develop specific movements in some graphic objects. ofPopMatrix needs to be called after. | |
void | ofPopMatrix () |
Restores the prior coordinate system. | |
glm::mat4 | ofGetCurrentMatrix (ofMatrixMode matrixMode_) |
Queries the current OpenGL matrix state @detail Returns the specified matrix as held by the renderer's current matrix stack. | |
glm::mat4 | ofGetCurrentOrientationMatrix () |
Query the current (oF internal) Orientation Matrix state. | |
glm::mat4 | ofGetCurrentNormalMatrix () |
Query the current (oF internal) Normal Matrix state. | |
void | ofTranslate (const glm::vec3 &p) |
void | ofTranslate (const glm::vec2 &p) |
void | ofTranslate (float x, float y, float z) |
Translate by (x,y,z) vector of our coordinate system. The call of ofTranslate() modifies graphics positions. | |
void | ofScale (float xAmnt, float yAmnt, float zAmnt) |
void | ofScale (float amount) |
Scale along the X, Y and Z axis with the same amount. | |
void | ofScale (const glm::vec3 &p) |
void | ofRotate (float degrees) |
void | ofRotate (float degrees, float vecX, float vecY, float vecZ) |
void | ofRotateX (float degrees) |
void | ofRotateY (float degrees) |
void | ofRotateZ (float degrees) |
void | ofRotateDeg (float degrees) |
Rotate around the z-axis. | |
void | ofRotateDeg (float degrees, float vecX, float vecY, float vecZ) |
Produces a rotation around the vector (vecX,vecY,vecZ). | |
void | ofRotateXDeg (float degrees) |
Produces a rotation around the X-axis of our coordinate system represented by the vector (1,0,0). | |
void | ofRotateYDeg (float degrees) |
Produces a rotation around the Y-axis of our coordinate system represented by the vector (0,1,0). | |
void | ofRotateZDeg (float degrees) |
Produces a rotation around the Z-axis of our coordinate system represented by the vector (0,0,1). | |
void | ofRotateRad (float radians) |
Rotate around the z-axis. | |
void | ofRotateRad (float radians, float vecX, float vecY, float vecZ) |
Produces a rotation around the vector (vecX,vecY,vecZ). | |
void | ofRotateXRad (float radians) |
Produces a rotation around the X-axis of our coordinate system represented by the vector (1,0,0). | |
void | ofRotateYRad (float radians) |
Produces a rotation around the Y-axis of our coordinate system represented by the vector (0,1,0). | |
void | ofRotateZRad (float radians) |
Produces a rotation around the Z-axis of our coordinate system represented by the vector (0,0,1). | |
void | ofLoadIdentityMatrix (void) |
void | ofLoadMatrix (const glm::mat4 &m) |
void | ofLoadMatrix (const float *m) |
void | ofMultMatrix (const glm::mat4 &m) |
void | ofMultMatrix (const float *m) |
void | ofSetMatrixMode (ofMatrixMode matrixMode) |
void | ofLoadViewMatrix (const glm::mat4 &m) |
void | ofMultViewMatrix (const glm::mat4 &m) |
glm::mat4 | ofGetCurrentViewMatrix () |
void | ofClear (float r, float g, float b, float a) |
Clears the color and depth bits of current renderer and replaces it with an RGB color. | |
void | ofClear (float brightness, float a) |
Clears the color and depth bits of current renderer and replaces it with a grayscale value. | |
void | ofClear (const ofColor &c) |
Clears the color and depth bits of current renderer and replaces it with an ofColor. | |
void | ofClearAlpha () |
void | ofSetBackgroundAuto (bool bAuto) |
Sets the background clearing function to be auto (default) or not. If non- auto, then background clearing will not occur per frame (at the start of draw) but rather, whenever ofBackground is called. | |
bool | ofGetBackgroundAuto () |
bool | ofbClearBg () |
ofColor | ofGetBackground () |
ofColor | ofGetBackgroundColor () |
Returns the current background color as an ofColor. | |
void | ofBackground (int brightness, int alpha) |
void | ofBackground (const ofColor &c) |
void | ofBackgroundHex (int hexColor, int alpha) |
Sets the background color using a hex color value. | |
void | ofBackground (int r, int g, int b, int a) |
Sets the background color. | |
void | ofBackgroundGradient (const ofColor &start, const ofColor &end, ofGradientMode mode) |
Sets the background color to a gradient. | |
void | ofSetBackgroundColor (int brightness, int alpha) |
void | ofSetBackgroundColorHex (int hexColor, int alpha) |
Sets the background color using a hex color value. | |
void | ofSetBackgroundColor (int r, int g, int b, int a) |
Sets the background color. It takes as input r,g,b (0-255). The background is cleared automatically, just before the draw() command, so if the background color is not changing, you could call this inside setup() (once, at the start of the application). If the background color is changing, you can call this inside update(). | |
void | ofSetBackgroundColor (const ofColor &c) |
void | ofSetRectMode (ofRectMode mode) |
Sets the mode for drawing rectangles and other rectangular objects, if they are corner aligned, or drawn so that the x,y position is the center of the rectangle. possible options are OF_RECTMODE_CENTER and OF_RECTMODE_CORNER . This affects not only how ofDrawRectangle() objects are drawn, but also ofTexture (and therefore ofImage) objects. | |
ofRectMode | ofGetRectMode () |
Tells you if rectangle drawing mode is set to drawn from the center or drawn from the top left corner, as set with the ofSetRectMode() function. | |
void | ofNoFill () |
Draw shapes as outlines with the current draw color. | |
void | ofFill () |
Draw shapes filled with the current draw color. | |
ofFillFlag | ofGetFill () |
void | ofSetLineWidth (float lineWidth) |
Sets the width of the ofDrawLine() called after. | |
void | ofSetDepthTest (bool depthTest) |
Set depth testing on or off to either sort by z-depth (true ) or draw order (false ). | |
void | ofEnableDepthTest () |
Turns on depth testing so rendering happens according to z-depth rather than draw order. | |
void | ofDisableDepthTest () |
Turn off depth testing so rendering happens in draw order rather than by z-depth. | |
void | ofSetCurveResolution (int res) |
void | ofSetCircleResolution (int res) |
Sets the resolution for the ofDrawCircle command. By default, the circle is 22 points, but if you need to draw larger circles, you can adjust the resolution using this command. All circles are cached in openGL using a display list for optimization purposes. | |
void | ofSetColor (const ofColor &color) |
void | ofSetColor (const ofColor &color, int _a) |
void | ofSetColor (int r, int g, int b) |
Sets the draw color with r,g,b, 0-255. For example, red would be: ofSetColor(255,0,0). This affects not only the color of shapes drawn with ofDrawRectangle(), ofDrawCircle(), etc, but also the tint of images and textures. | |
void | ofSetColor (int r, int g, int b, int a) |
Sets the draw color with r,g,b,a 0-255. | |
void | ofSetColor (int gray) |
void | ofSetHexColor (int hexColor) |
void | ofEnableBlendMode (ofBlendMode blendMode) |
Sets and enables the blend mode for drawing. The options are: | |
void | ofEnablePointSprites () |
Turn on point sprite. | |
void | ofDisablePointSprites () |
Turn off point sprites. | |
void | ofDisableBlendMode () |
Disable the current blend mode. | |
void | ofEnableAlphaBlending () |
Turns on alpha blending (which is on by default since OF version 0.8.0). It simply wraps opengl commands that enable blending, and turn on a common blend mode. | |
void | ofDisableAlphaBlending () |
Turn off alpha blending. | |
void | ofEnableSmoothing () |
void | ofDisableSmoothing () |
Turn off smoothing. Currently, this only works for lines. You can draw a filled object, and then draw the outline with smoothing enabled to get smoothing effects on filled shapes. | |
void | ofSetPolyMode (ofPolyWindingMode mode) |
Sets the drawing behavior for overlapping parts of the same polygon. | |
void | ofEnableAntiAliasing () |
Enables anti-aliasing (smoothing) for lines. | |
void | ofDisableAntiAliasing () |
Turns off anti-aliasing (smoothing). | |
void | ofSetDrawBitmapMode (ofDrawBitmapMode mode) |
Set the bitmap drawing mode. | |
void | ofSetStyle (ofStyle style) |
Set the current style of the ofGraphics. | |
ofStyle | ofGetStyle () |
void | ofPushStyle () |
Saves the current style settings for the ofGraphics after its call. Usage of ofPushStyle and ofPopStyle allow users to have more control of certain graphics elements. All the style that applies to certain elements is controled using ofStyle class. See ofStyle type. | |
void | ofPopStyle () |
Restores the prior style settings. It needs to be called after ofPushStyle. | |
void | ofDrawTriangle (const glm::vec3 &p1, const glm::vec3 &p2, const glm::vec3 &p3) |
void | ofDrawTriangle (const glm::vec2 &p1, const glm::vec2 &p2, const glm::vec2 &p3) |
void | ofDrawTriangle (float x1, float y1, float x2, float y2, float x3, float y3) |
Draws a triangle, with the three points: (x1,y1),(x2, y2),(x3, y3). | |
void | ofDrawTriangle (float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3) |
void | ofDrawCircle (const glm::vec3 &p, float radius) |
void | ofDrawCircle (const glm::vec2 &p, float radius) |
void | ofDrawCircle (float x, float y, float radius) |
Draws a circle, centered at x,y, with a given radius. | |
void | ofDrawCircle (float x, float y, float z, float radius) |
void | ofDrawEllipse (const glm::vec3 &p, float width, float height) |
void | ofDrawEllipse (const glm::vec2 &p, float width, float height) |
void | ofDrawEllipse (float x, float y, float width, float height) |
Draws an ellipse from point (x,y) with a given width (w) and height (h). | |
void | ofDrawEllipse (float x, float y, float z, float width, float height) |
void | ofDrawLine (const glm::vec3 &p1, const glm::vec3 &p2) |
void | ofDrawLine (const glm::vec2 &p1, const glm::vec2 &p2) |
void | ofDrawLine (float x1, float y1, float x2, float y2) |
void | ofDrawLine (float x1, float y1, float z1, float x2, float y2, float z2) |
void | ofDrawRectangle (const ofRectangle &r) |
Draws an rectangle from the given rectangle. | |
void | ofDrawRectangle (const glm::vec3 &p, float w, float h) |
Draws an rectangle from point p, with a given width and height. | |
void | ofDrawRectangle (const glm::vec2 &p, float w, float h) |
void | ofDrawRectangle (float x, float y, float w, float h) |
Draws a rectangle from point x,y with a given width and height. | |
void | ofDrawRectangle (float x, float y, float z, float w, float h) |
void | ofDrawRectRounded (const ofRectangle &b, float r) |
Draws a rounded rectangle from the given rectangle using given radius. | |
void | ofDrawRectRounded (const glm::vec3 &p, float w, float h, float r) |
Draws a rectangle from point p with a given width, height and radius of rounded corners. | |
void | ofDrawRectRounded (const glm::vec2 &p, float w, float h, float r) |
void | ofDrawRectRounded (float x, float y, float w, float h, float r) |
Draws a rectangle from point X, Y with a given width, height and radius of rounded corners. | |
void | ofDrawRectRounded (float x, float y, float z, float w, float h, float r) |
Draws a rectangle from point X, Y, at depth Z with a given width, height and radius of rounded corners. | |
void | ofDrawRectRounded (const glm::vec3 &p, float w, float h, float topLeftRadius, float topRightRadius, float bottomRightRadius, float bottomLeftRadius) |
Draws a rounded rectangle from point X, Y, at depth Z with a given width, height and radius of rounded corners. | |
void | ofDrawRectRounded (const glm::vec2 &p, float w, float h, float topLeftRadius, float topRightRadius, float bottomRightRadius, float bottomLeftRadius) |
void | ofDrawRectRounded (const ofRectangle &b, float topLeftRadius, float topRightRadius, float bottomRightRadius, float bottomLeftRadius) |
Draws a rounded rectangle from the given rectangle using different given radius for each of the corners. | |
void | ofDrawRectRounded (float x, float y, float z, float w, float h, float topLeftRadius, float topRightRadius, float bottomRightRadius, float bottomLeftRadius) |
Draws a rounded rectangle from point X, Y, at depth Z with a given width, height and different radius for each rounded corner. | |
void | ofDrawCurve (float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) |
Draws a curve from point (x1, y1) to point (x2, y2). The curve is shaped by the two control points (x0,y0) and (x3,y3). | |
void | ofDrawCurve (float x0, float y0, float z0, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3) |
Draws a 3-dimensional curve from point (x1, y1, z1) to point (x2, y2, z2). The curve is shaped by the two control points (x0, y0, z0) and (x3, y3, z3). | |
void | ofDrawBezier (float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) |
void | ofDrawBezier (float x0, float y0, float z0, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3) |
void | ofTriangle (const glm::vec3 &p1, const glm::vec3 &p2, const glm::vec3 &p3) |
void | ofTriangle (float x1, float y1, float x2, float y2, float x3, float y3) |
void | ofTriangle (float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3) |
void | ofCircle (const glm::vec3 &p, float radius) |
void | ofCircle (float x, float y, float radius) |
void | ofCircle (float x, float y, float z, float radius) |
void | ofEllipse (const glm::vec3 &p, float width, float height) |
void | ofEllipse (float x, float y, float width, float height) |
void | ofEllipse (float x, float y, float z, float width, float height) |
void | ofLine (const glm::vec3 &p1, const glm::vec3 &p2) |
void | ofLine (float x1, float y1, float x2, float y2) |
void | ofLine (float x1, float y1, float z1, float x2, float y2, float z2) |
void | ofRect (const ofRectangle &r) |
void | ofRect (const glm::vec3 &p, float w, float h) |
void | ofRect (float x, float y, float w, float h) |
void | ofRect (float x, float y, float z, float w, float h) |
void | ofRectRounded (const ofRectangle &b, float r) |
void | ofRectRounded (const glm::vec3 &p, float w, float h, float r) |
void | ofRectRounded (float x, float y, float w, float h, float r) |
void | ofRectRounded (float x, float y, float z, float w, float h, float r) |
void | ofRectRounded (const glm::vec3 &p, float w, float h, float topLeftRadius, float topRightRadius, float bottomRightRadius, float bottomLeftRadius) |
void | ofRectRounded (const ofRectangle &b, float topLeftRadius, float topRightRadius, float bottomRightRadius, float bottomLeftRadius) |
void | ofRectRounded (float x, float y, float z, float w, float h, float topLeftRadius, float topRightRadius, float bottomRightRadius, float bottomLeftRadius) |
void | ofCurve (float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) |
void | ofCurve (float x0, float y0, float z0, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3) |
void | ofBezier (float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) |
void | ofBezier (float x0, float y0, float z0, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3) |
void | ofBeginShape () |
Start drawing a new shape. Needs to be followed by a list of vertex points and lastly a call to ofEndShape(). | |
void | ofVertex (float x, float y) |
Specifies a single point of a shape. To be called between ofBeginShape() and ofEndShape(). | |
void | ofVertex (float x, float y, float z) |
void | ofVertex (const glm::vec3 &p) |
void | ofVertex (const glm::vec2 &p) |
void | ofVertices (const vector< glm::vec3 > &polyPoints) |
void | ofVertices (const vector< glm::vec2 > &polyPoints) |
void | ofVertices (const vector< ofVec3f > &polyPoints) |
void | ofVertices (const vector< ofVec2f > &polyPoints) |
void | ofCurveVertex (float x, float y) |
Specifies a single point of a shape. The difference from ofVertex is that the line describing the edge of the shape between two points will be a curve as opposed to a straight line. The curve is automatically generated using the catmull from formula. | |
void | ofCurveVertex (float x, float y, float z) |
void | ofCurveVertices (const vector< glm::vec3 > &curvePoints) |
void | ofCurveVertices (const vector< glm::vec2 > &curvePoints) |
void | ofCurveVertices (const vector< ofVec3f > &curvePoints) |
void | ofCurveVertices (const vector< ofVec2f > &curvePoints) |
void | ofCurveVertex (const glm::vec3 &p) |
void | ofCurveVertex (const glm::vec2 &p) |
void | ofBezierVertex (float x1, float y1, float x2, float y2, float x3, float y3) |
Describes a bezier curve through three points of a shape. To be called between ofBeginShape() and ofEndShape(). | |
void | ofBezierVertex (const glm::vec3 &p1, const glm::vec3 &p2, const glm::vec3 &p3) |
void | ofBezierVertex (const glm::vec2 &p1, const glm::vec2 &p2, const glm::vec2 &p3) |
void | ofBezierVertex (float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3) |
void | ofNextContour (bool bClose) |
Allows you to draw multiple contours within one shape. Call this between ofBeginShape() and ofEndShape() to create a new contour for your shape. | |
void | ofEndShape (bool bClose) |
This tells the program that your shape is finished and that it should now draw it to the screen. | |
template<> | |
void | ofDrawBitmapString (const string &textString, float x, float y, float z) |
template<> | |
void | ofDrawBitmapString (const std::string &textString, const glm::vec3 &p) |
template<> | |
void | ofDrawBitmapString (const std::string &textString, const glm::vec2 &p) |
void | ofDrawBitmapStringHighlight (string text, const glm::vec3 &position, const ofColor &background, const ofColor &foreground) |
void | ofDrawBitmapStringHighlight (string text, const glm::vec2 &position, const ofColor &background, const ofColor &foreground) |
void | ofDrawBitmapStringHighlight (string text, int x, int y, const ofColor &background, const ofColor &foreground) |
Macro Definition Documentation
◆ CALLBACK
#define CALLBACK |
Function Documentation
◆ ofBackground() [1/3]
void ofBackground | ( | const ofColor & | c | ) |
◆ ofBackground() [2/3]
void ofBackground | ( | int | brightness, |
int | alpha | ||
) |
◆ ofBackground() [3/3]
void ofBackground | ( | int | r, |
int | g, | ||
int | b, | ||
int | a = 255 |
||
) |
Sets the background color.
It takes as input r,g,b (0-255). The background is cleared automatically, just before the draw() command, so if the background color is not changing, you could call this inside of setup() (once, at the start of the application). If the background color is changing, you can call this inside of update().
◆ ofBackgroundGradient()
void ofBackgroundGradient | ( | const ofColor & | start, |
const ofColor & | end, | ||
ofGradientMode | mode = OF_GRADIENT_CIRCULAR |
||
) |
Sets the background color to a gradient.
It takes as input 2 ofColor() objects and a Gradient Mode. Must be called in the draw() function.
Accepted modes are:
- Circular:
OF_GRADIENT_CIRCULAR
- Linear:
OF_GRADIENT_LINEAR
- Bar:
OF_GRADIENT_BAR
Background Gradient: Circular:
Background Gradient: Linear:
Background Gradient: Bar:
TODO: revert to glm::vec2!!
◆ ofBackgroundHex()
void ofBackgroundHex | ( | int | hexColor, |
int | alpha = 255 |
||
) |
Sets the background color using a hex color value.
◆ ofbClearBg()
bool ofbClearBg | ( | ) |
◆ ofBeginShape()
void ofBeginShape | ( | ) |
Start drawing a new shape. Needs to be followed by a list of vertex points and lastly a call to ofEndShape().
- See also
- ofEndShape()
◆ ofBezier() [1/2]
void ofBezier | ( | float | x0, |
float | y0, | ||
float | x1, | ||
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | x3, | ||
float | y3 | ||
) |
◆ ofBezier() [2/2]
void ofBezier | ( | float | x0, |
float | y0, | ||
float | z0, | ||
float | x1, | ||
float | y1, | ||
float | z1, | ||
float | x2, | ||
float | y2, | ||
float | z2, | ||
float | x3, | ||
float | y3, | ||
float | z3 | ||
) |
◆ ofBezierVertex() [1/4]
void ofBezierVertex | ( | const glm::vec2 & | p1, |
const glm::vec2 & | p2, | ||
const glm::vec2 & | p3 | ||
) |
◆ ofBezierVertex() [2/4]
void ofBezierVertex | ( | const glm::vec3 & | p1, |
const glm::vec3 & | p2, | ||
const glm::vec3 & | p3 | ||
) |
◆ ofBezierVertex() [3/4]
void ofBezierVertex | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | x3, | ||
float | y3 | ||
) |
Describes a bezier curve through three points of a shape. To be called between ofBeginShape() and ofEndShape().
◆ ofBezierVertex() [4/4]
void ofBezierVertex | ( | float | x1, |
float | y1, | ||
float | z1, | ||
float | x2, | ||
float | y2, | ||
float | z2, | ||
float | x3, | ||
float | y3, | ||
float | z3 | ||
) |
◆ ofCircle() [1/3]
void ofCircle | ( | const glm::vec3 & | p, |
float | radius | ||
) |
◆ ofCircle() [2/3]
void ofCircle | ( | float | x, |
float | y, | ||
float | radius | ||
) |
◆ ofCircle() [3/3]
void ofCircle | ( | float | x, |
float | y, | ||
float | z, | ||
float | radius | ||
) |
◆ ofClear() [1/3]
void ofClear | ( | const ofColor & | c | ) |
Clears the color and depth bits of current renderer and replaces it with an ofColor.
◆ ofClear() [2/3]
void ofClear | ( | float | brightness, |
float | a = 0 |
||
) |
Clears the color and depth bits of current renderer and replaces it with a grayscale value.
◆ ofClear() [3/3]
void ofClear | ( | float | r, |
float | g, | ||
float | b, | ||
float | a = 0 |
||
) |
Clears the color and depth bits of current renderer and replaces it with an RGB color.
When drawing to the screen, ofClear() will clear the screen entirely.
When using the openGL renderer and drawing into an FBO, ofClear() will clear that buffer rather than the main screen.
◆ ofClearAlpha()
void ofClearAlpha | ( | ) |
◆ ofCurve() [1/2]
void ofCurve | ( | float | x0, |
float | y0, | ||
float | x1, | ||
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | x3, | ||
float | y3 | ||
) |
◆ ofCurve() [2/2]
void ofCurve | ( | float | x0, |
float | y0, | ||
float | z0, | ||
float | x1, | ||
float | y1, | ||
float | z1, | ||
float | x2, | ||
float | y2, | ||
float | z2, | ||
float | x3, | ||
float | y3, | ||
float | z3 | ||
) |
◆ ofCurveVertex() [1/4]
void ofCurveVertex | ( | const glm::vec2 & | p | ) |
◆ ofCurveVertex() [2/4]
void ofCurveVertex | ( | const glm::vec3 & | p | ) |
◆ ofCurveVertex() [3/4]
void ofCurveVertex | ( | float | x, |
float | y | ||
) |
Specifies a single point of a shape. The difference from ofVertex is that the line describing the edge of the shape between two points will be a curve as opposed to a straight line. The curve is automatically generated using the catmull from formula.
This function has to be called between ofBeginShape() and ofEndShape().
◆ ofCurveVertex() [4/4]
void ofCurveVertex | ( | float | x, |
float | y, | ||
float | z | ||
) |
◆ ofCurveVertices() [1/4]
void ofCurveVertices | ( | const vector< glm::vec2 > & | curvePoints | ) |
◆ ofCurveVertices() [2/4]
void ofCurveVertices | ( | const vector< glm::vec3 > & | curvePoints | ) |
◆ ofCurveVertices() [3/4]
void ofCurveVertices | ( | const vector< ofVec2f > & | curvePoints | ) |
◆ ofCurveVertices() [4/4]
void ofCurveVertices | ( | const vector< ofVec3f > & | curvePoints | ) |
◆ ofDisableAlphaBlending()
void ofDisableAlphaBlending | ( | ) |
Turn off alpha blending.
- See also
- ofEnableAlphaBlending()
◆ ofDisableAntiAliasing()
void ofDisableAntiAliasing | ( | ) |
Turns off anti-aliasing (smoothing).
◆ ofDisableBlendMode()
void ofDisableBlendMode | ( | ) |
Disable the current blend mode.
◆ ofDisableDepthTest()
void ofDisableDepthTest | ( | ) |
Turn off depth testing so rendering happens in draw order rather than by z-depth.
Turning off depth test is useful for combining 3d scenes with 2d overlays such as a control panel.
- See also
- ofEnableDepthTest()
◆ ofDisablePointSprites()
void ofDisablePointSprites | ( | ) |
Turn off point sprites.
◆ ofDisableSmoothing()
void ofDisableSmoothing | ( | ) |
Turn off smoothing. Currently, this only works for lines. You can draw a filled object, and then draw the outline with smoothing enabled to get smoothing effects on filled shapes.
◆ ofDrawBezier() [1/2]
void ofDrawBezier | ( | float | x0, |
float | y0, | ||
float | x1, | ||
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | x3, | ||
float | y3 | ||
) |
◆ ofDrawBezier() [2/2]
void ofDrawBezier | ( | float | x0, |
float | y0, | ||
float | z0, | ||
float | x1, | ||
float | y1, | ||
float | z1, | ||
float | x2, | ||
float | y2, | ||
float | z2, | ||
float | x3, | ||
float | y3, | ||
float | z3 | ||
) |
◆ ofDrawBitmapString() [1/3]
void ofDrawBitmapString | ( | const std::string & | textString, |
const glm::vec2 & | p | ||
) |
◆ ofDrawBitmapString() [2/3]
void ofDrawBitmapString | ( | const std::string & | textString, |
const glm::vec3 & | p | ||
) |
◆ ofDrawBitmapString() [3/3]
void ofDrawBitmapString | ( | const string & | textString, |
float | x, | ||
float | y, | ||
float | z | ||
) |
◆ ofDrawBitmapStringHighlight() [1/3]
void ofDrawBitmapStringHighlight | ( | string | text, |
const glm::vec2 & | position, | ||
const ofColor & | background, | ||
const ofColor & | foreground | ||
) |
◆ ofDrawBitmapStringHighlight() [2/3]
void ofDrawBitmapStringHighlight | ( | string | text, |
const glm::vec3 & | position, | ||
const ofColor & | background, | ||
const ofColor & | foreground | ||
) |
◆ ofDrawBitmapStringHighlight() [3/3]
void ofDrawBitmapStringHighlight | ( | string | text, |
int | x, | ||
int | y, | ||
const ofColor & | background, | ||
const ofColor & | foreground | ||
) |
◆ ofDrawCircle() [1/4]
void ofDrawCircle | ( | const glm::vec2 & | p, |
float | radius | ||
) |
◆ ofDrawCircle() [2/4]
void ofDrawCircle | ( | const glm::vec3 & | p, |
float | radius | ||
) |
◆ ofDrawCircle() [3/4]
void ofDrawCircle | ( | float | x, |
float | y, | ||
float | radius | ||
) |
Draws a circle, centered at x,y, with a given radius.
Please keep in mind that drawing circle with different outline color and fill requires calling ofNoFill and ofSetColor for drawing stroke and ofFill and again ofSetColor for filled solid color circle.
◆ ofDrawCircle() [4/4]
void ofDrawCircle | ( | float | x, |
float | y, | ||
float | z, | ||
float | radius | ||
) |
◆ ofDrawCurve() [1/2]
void ofDrawCurve | ( | float | x0, |
float | y0, | ||
float | x1, | ||
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | x3, | ||
float | y3 | ||
) |
Draws a curve from point (x1, y1) to point (x2, y2). The curve is shaped by the two control points (x0,y0) and (x3,y3).
◆ ofDrawCurve() [2/2]
void ofDrawCurve | ( | float | x0, |
float | y0, | ||
float | z0, | ||
float | x1, | ||
float | y1, | ||
float | z1, | ||
float | x2, | ||
float | y2, | ||
float | z2, | ||
float | x3, | ||
float | y3, | ||
float | z3 | ||
) |
Draws a 3-dimensional curve from point (x1, y1, z1) to point (x2, y2, z2). The curve is shaped by the two control points (x0, y0, z0) and (x3, y3, z3).
◆ ofDrawEllipse() [1/4]
void ofDrawEllipse | ( | const glm::vec2 & | p, |
float | width, | ||
float | height | ||
) |
◆ ofDrawEllipse() [2/4]
void ofDrawEllipse | ( | const glm::vec3 & | p, |
float | width, | ||
float | height | ||
) |
◆ ofDrawEllipse() [3/4]
void ofDrawEllipse | ( | float | x, |
float | y, | ||
float | width, | ||
float | height | ||
) |
Draws an ellipse from point (x,y) with a given width (w) and height (h).
◆ ofDrawEllipse() [4/4]
void ofDrawEllipse | ( | float | x, |
float | y, | ||
float | z, | ||
float | width, | ||
float | height | ||
) |
◆ ofDrawLine() [1/4]
void ofDrawLine | ( | const glm::vec2 & | p1, |
const glm::vec2 & | p2 | ||
) |
◆ ofDrawLine() [2/4]
void ofDrawLine | ( | const glm::vec3 & | p1, |
const glm::vec3 & | p2 | ||
) |
◆ ofDrawLine() [3/4]
void ofDrawLine | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2 | ||
) |
Draws a line between two points: (x1,y1),(x2,y2).
◆ ofDrawLine() [4/4]
void ofDrawLine | ( | float | x1, |
float | y1, | ||
float | z1, | ||
float | x2, | ||
float | y2, | ||
float | z2 | ||
) |
◆ ofDrawRectangle() [1/5]
void ofDrawRectangle | ( | const glm::vec2 & | p, |
float | w, | ||
float | h | ||
) |
◆ ofDrawRectangle() [2/5]
void ofDrawRectangle | ( | const glm::vec3 & | p, |
float | w, | ||
float | h | ||
) |
Draws an rectangle from point p, with a given width and height.
◆ ofDrawRectangle() [3/5]
void ofDrawRectangle | ( | const ofRectangle & | r | ) |
Draws an rectangle from the given rectangle.
◆ ofDrawRectangle() [4/5]
void ofDrawRectangle | ( | float | x1, |
float | y1, | ||
float | w, | ||
float | h | ||
) |
Draws a rectangle from point x,y with a given width and height.
◆ ofDrawRectangle() [5/5]
void ofDrawRectangle | ( | float | x, |
float | y, | ||
float | z, | ||
float | w, | ||
float | h | ||
) |
Draws an rectangle from point X, Y at depth Z with a given width and height.
◆ ofDrawRectRounded() [1/9]
void ofDrawRectRounded | ( | const glm::vec2 & | p, |
float | w, | ||
float | h, | ||
float | r | ||
) |
◆ ofDrawRectRounded() [2/9]
void ofDrawRectRounded | ( | const glm::vec2 & | p, |
float | w, | ||
float | h, | ||
float | topLeftRadius, | ||
float | topRightRadius, | ||
float | bottomRightRadius, | ||
float | bottomLeftRadius | ||
) |
◆ ofDrawRectRounded() [3/9]
void ofDrawRectRounded | ( | const glm::vec3 & | p, |
float | w, | ||
float | h, | ||
float | r | ||
) |
Draws a rectangle from point p with a given width, height and radius of rounded corners.
◆ ofDrawRectRounded() [4/9]
void ofDrawRectRounded | ( | const glm::vec3 & | p, |
float | w, | ||
float | h, | ||
float | topLeftRadius, | ||
float | topRightRadius, | ||
float | bottomRightRadius, | ||
float | bottomLeftRadius | ||
) |
Draws a rounded rectangle from point X, Y, at depth Z with a given width, height and radius of rounded corners.
◆ ofDrawRectRounded() [5/9]
void ofDrawRectRounded | ( | const ofRectangle & | b, |
float | r | ||
) |
Draws a rounded rectangle from the given rectangle using given radius.
◆ ofDrawRectRounded() [6/9]
void ofDrawRectRounded | ( | const ofRectangle & | b, |
float | topLeftRadius, | ||
float | topRightRadius, | ||
float | bottomRightRadius, | ||
float | bottomLeftRadius | ||
) |
Draws a rounded rectangle from the given rectangle using different given radius for each of the corners.
◆ ofDrawRectRounded() [7/9]
void ofDrawRectRounded | ( | float | x, |
float | y, | ||
float | w, | ||
float | h, | ||
float | r | ||
) |
Draws a rectangle from point X, Y with a given width, height and radius of rounded corners.
◆ ofDrawRectRounded() [8/9]
void ofDrawRectRounded | ( | float | x, |
float | y, | ||
float | z, | ||
float | w, | ||
float | h, | ||
float | r | ||
) |
Draws a rectangle from point X, Y, at depth Z with a given width, height and radius of rounded corners.
◆ ofDrawRectRounded() [9/9]
void ofDrawRectRounded | ( | float | x, |
float | y, | ||
float | z, | ||
float | w, | ||
float | h, | ||
float | topLeftRadius, | ||
float | topRightRadius, | ||
float | bottomRightRadius, | ||
float | bottomLeftRadius | ||
) |
Draws a rounded rectangle from point X, Y, at depth Z with a given width, height and different radius for each rounded corner.
◆ ofDrawTriangle() [1/4]
void ofDrawTriangle | ( | const glm::vec2 & | p1, |
const glm::vec2 & | p2, | ||
const glm::vec2 & | p3 | ||
) |
◆ ofDrawTriangle() [2/4]
void ofDrawTriangle | ( | const glm::vec3 & | p1, |
const glm::vec3 & | p2, | ||
const glm::vec3 & | p3 | ||
) |
◆ ofDrawTriangle() [3/4]
void ofDrawTriangle | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | x3, | ||
float | y3 | ||
) |
Draws a triangle, with the three points: (x1,y1),(x2, y2),(x3, y3).
◆ ofDrawTriangle() [4/4]
void ofDrawTriangle | ( | float | x1, |
float | y1, | ||
float | z1, | ||
float | x2, | ||
float | y2, | ||
float | z2, | ||
float | x3, | ||
float | y3, | ||
float | z3 | ||
) |
◆ ofEllipse() [1/3]
void ofEllipse | ( | const glm::vec3 & | p, |
float | width, | ||
float | height | ||
) |
◆ ofEllipse() [2/3]
void ofEllipse | ( | float | x, |
float | y, | ||
float | width, | ||
float | height | ||
) |
◆ ofEllipse() [3/3]
void ofEllipse | ( | float | x, |
float | y, | ||
float | z, | ||
float | width, | ||
float | height | ||
) |
◆ ofEnableAlphaBlending()
void ofEnableAlphaBlending | ( | ) |
Turns on alpha blending (which is on by default since OF version 0.8.0). It simply wraps opengl commands that enable blending, and turn on a common blend mode.
◆ ofEnableAntiAliasing()
void ofEnableAntiAliasing | ( | ) |
Enables anti-aliasing (smoothing) for lines.
◆ ofEnableBlendMode()
void ofEnableBlendMode | ( | ofBlendMode | blendMode | ) |
Sets and enables the blend mode for drawing. The options are:
OF_BLENDMODE_DISABLED OF_BLENDMODE_ALPHA OF_BLENDMODE_ADD OF_BLENDMODE_SUBTRACT OF_BLENDMODE_MULTIPLY OF_BLENDMODE_SCREEN
There is a blendingExample in the openFrameworks examples > graphics
◆ ofEnableDepthTest()
void ofEnableDepthTest | ( | ) |
Turns on depth testing so rendering happens according to z-depth rather than draw order.
- See also
- ofDisableDepthTest()
◆ ofEnablePointSprites()
void ofEnablePointSprites | ( | ) |
Turn on point sprite.
Textures can be mapped onto points. By default, point size is 1pt. So texture is not shown correctly. You can change point size by `glPointSize(GLfloat size).
◆ ofEnableSmoothing()
void ofEnableSmoothing | ( | ) |
◆ ofEndShape()
void ofEndShape | ( | bool | bClose = false | ) |
This tells the program that your shape is finished and that it should now draw it to the screen.
This function must be called otherwise you will not see your shape.
- Parameters
-
bClose If you set it to true it will automatically close your shape for you. Default false.
◆ ofFill()
void ofFill | ( | ) |
Draw shapes filled with the current draw color.
◆ ofGetBackground()
ofColor ofGetBackground | ( | ) |
◆ ofGetBackgroundAuto()
bool ofGetBackgroundAuto | ( | ) |
◆ ofGetBackgroundColor()
ofColor ofGetBackgroundColor | ( | ) |
Returns the current background color as an ofColor.
◆ ofGetCoordHandedness()
ofHandednessType ofGetCoordHandedness | ( | ) |
◆ ofGetCurrentMatrix()
glm::mat4 ofGetCurrentMatrix | ( | ofMatrixMode | matrixMode_ | ) |
Queries the current OpenGL matrix state @detail Returns the specified matrix as held by the renderer's current matrix stack.
Query the current (oF internal) Transformation Matrix state.
You can query one of the following: [OF_MATRIX_MODELVIEW | OF_MATRIX_PROJECTION | OF_MATRIX_TEXTURE] Each query will return the state of the matrix as it was uploaded to the shader currently bound.
- Parameters
-
matrixMode_ Which matrix mode to query
◆ ofGetCurrentNormalMatrix()
glm::mat4 ofGetCurrentNormalMatrix | ( | ) |
Query the current (oF internal) Normal Matrix state.
- Note
- The matrix returned is the transposed of the inverse of the view matrix
Currently, only GL Programmable Renderer and GL Renderer implement ofGetCurrentNormalMatrix.
◆ ofGetCurrentOrientationMatrix()
glm::mat4 ofGetCurrentOrientationMatrix | ( | ) |
Query the current (oF internal) Orientation Matrix state.
- Note
- The matrix returned is the matrix openFrameworks uses internally to calculate the (final, oriented) projection matrix as it is passed on to the GPU.
Currently, only GL Programmable Renderer and GL Renderer implement ofGetCurrentOrientationMatrix.
◆ ofGetCurrentViewMatrix()
glm::mat4 ofGetCurrentViewMatrix | ( | ) |
◆ ofGetCurrentViewport()
ofRectangle ofGetCurrentViewport | ( | ) |
Get the position and size of the current viewport.
- Returns
- A rectangle describing the viewport
◆ ofGetFill()
ofFillFlag ofGetFill | ( | ) |
◆ ofGetNativeViewport()
ofRectangle ofGetNativeViewport | ( | ) |
Get the position and size of the native viewport.
- Returns
- A rectangle describing the viewport
◆ ofGetRectMode()
ofRectMode ofGetRectMode | ( | ) |
Tells you if rectangle drawing mode is set to drawn from the center or drawn from the top left corner, as set with the ofSetRectMode() function.
Default is OF_RECTMODE_CORNER
- See also
- ofSetRectMode()
◆ ofGetStyle()
ofStyle ofGetStyle | ( | ) |
◆ ofGetViewportHeight()
int ofGetViewportHeight | ( | ) |
Get the height of the current viewport.
- Returns
- A height in pixels
◆ ofGetViewportWidth()
int ofGetViewportWidth | ( | ) |
Get the width of the current viewport.
- Returns
- A width in pixels
◆ ofIsVFlipped()
bool ofIsVFlipped | ( | ) |
Get if view is flipped vertically.
◆ ofLine() [1/3]
void ofLine | ( | const glm::vec3 & | p1, |
const glm::vec3 & | p2 | ||
) |
◆ ofLine() [2/3]
void ofLine | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2 | ||
) |
◆ ofLine() [3/3]
void ofLine | ( | float | x1, |
float | y1, | ||
float | z1, | ||
float | x2, | ||
float | y2, | ||
float | z2 | ||
) |
◆ ofLoadIdentityMatrix()
void ofLoadIdentityMatrix | ( | void | ) |
◆ ofLoadMatrix() [1/2]
void ofLoadMatrix | ( | const float * | m | ) |
◆ ofLoadMatrix() [2/2]
void ofLoadMatrix | ( | const glm::mat4 & | m | ) |
◆ ofLoadViewMatrix()
void ofLoadViewMatrix | ( | const glm::mat4 & | m | ) |
◆ ofMultMatrix() [1/2]
void ofMultMatrix | ( | const float * | m | ) |
◆ ofMultMatrix() [2/2]
void ofMultMatrix | ( | const glm::mat4 & | m | ) |
◆ ofMultViewMatrix()
void ofMultViewMatrix | ( | const glm::mat4 & | m | ) |
◆ ofNextContour()
void ofNextContour | ( | bool | bClose = false | ) |
Allows you to draw multiple contours within one shape. Call this between ofBeginShape() and ofEndShape() to create a new contour for your shape.
- Parameters
-
bClose If set to true then the previous contour will be automatically closed. Default false
◆ ofNoFill()
void ofNoFill | ( | ) |
Draw shapes as outlines with the current draw color.
◆ ofOrientationToDegrees()
int ofOrientationToDegrees | ( | ofOrientation | orientation | ) |
◆ ofPopMatrix()
void ofPopMatrix | ( | ) |
Restores the prior coordinate system.
- See also
- ofPushMatrix()
◆ ofPopStyle()
void ofPopStyle | ( | ) |
Restores the prior style settings. It needs to be called after ofPushStyle.
- See also
- ofPushStyle()
◆ ofPopView()
void ofPopView | ( | ) |
Restores the viewport and matrix settings set by ofPushView()
◆ ofPushMatrix()
void ofPushMatrix | ( | ) |
Saves the current coordinate system allowing users to develop specific movements in some graphic objects. ofPopMatrix needs to be called after.
In the following example we only rotate the square.
◆ ofPushStyle()
void ofPushStyle | ( | ) |
Saves the current style settings for the ofGraphics after its call. Usage of ofPushStyle and ofPopStyle allow users to have more control of certain graphics elements. All the style that applies to certain elements is controled using ofStyle class. See ofStyle type.
In the following example the properties of being red and filled only applies to the ellipse:
sa ofPopStyle()
◆ ofPushView()
void ofPushView | ( | ) |
Stores the current viewport and matrix settings.
◆ ofRect() [1/4]
void ofRect | ( | const glm::vec3 & | p, |
float | w, | ||
float | h | ||
) |
◆ ofRect() [2/4]
void ofRect | ( | const ofRectangle & | r | ) |
◆ ofRect() [3/4]
void ofRect | ( | float | x, |
float | y, | ||
float | w, | ||
float | h | ||
) |
◆ ofRect() [4/4]
void ofRect | ( | float | x, |
float | y, | ||
float | z, | ||
float | w, | ||
float | h | ||
) |
◆ ofRectRounded() [1/7]
void ofRectRounded | ( | const glm::vec3 & | p, |
float | w, | ||
float | h, | ||
float | r | ||
) |
◆ ofRectRounded() [2/7]
void ofRectRounded | ( | const glm::vec3 & | p, |
float | w, | ||
float | h, | ||
float | topLeftRadius, | ||
float | topRightRadius, | ||
float | bottomRightRadius, | ||
float | bottomLeftRadius | ||
) |
◆ ofRectRounded() [3/7]
void ofRectRounded | ( | const ofRectangle & | b, |
float | r | ||
) |
◆ ofRectRounded() [4/7]
void ofRectRounded | ( | const ofRectangle & | b, |
float | topLeftRadius, | ||
float | topRightRadius, | ||
float | bottomRightRadius, | ||
float | bottomLeftRadius | ||
) |
◆ ofRectRounded() [5/7]
void ofRectRounded | ( | float | x, |
float | y, | ||
float | w, | ||
float | h, | ||
float | r | ||
) |
◆ ofRectRounded() [6/7]
void ofRectRounded | ( | float | x, |
float | y, | ||
float | z, | ||
float | w, | ||
float | h, | ||
float | r | ||
) |
◆ ofRectRounded() [7/7]
void ofRectRounded | ( | float | x, |
float | y, | ||
float | z, | ||
float | w, | ||
float | h, | ||
float | topLeftRadius, | ||
float | topRightRadius, | ||
float | bottomRightRadius, | ||
float | bottomLeftRadius | ||
) |
◆ ofRotate() [1/2]
void ofRotate | ( | float | degrees | ) |
◆ ofRotate() [2/2]
void ofRotate | ( | float | degrees, |
float | vecX, | ||
float | vecY, | ||
float | vecZ | ||
) |
◆ ofRotateDeg() [1/2]
void ofRotateDeg | ( | float | degrees | ) |
Rotate around the z-axis.
◆ ofRotateDeg() [2/2]
void ofRotateDeg | ( | float | degrees, |
float | vecX, | ||
float | vecY, | ||
float | vecZ | ||
) |
Produces a rotation around the vector (vecX,vecY,vecZ).
All graphics drawn after ofRotate is called are rotated. Use ofPushMatrix() and ofPopMatrix() to save and restore the unrotated coordinate system.
- Parameters
-
degrees Specifies the angle of rotation, in degrees. vecX specifies the x coordinates of a vector vecY specifies the y coordinates of a vector vecZ specifies the z coordinates of a vector
◆ ofRotateRad() [1/2]
void ofRotateRad | ( | float | radians | ) |
Rotate around the z-axis.
◆ ofRotateRad() [2/2]
void ofRotateRad | ( | float | radians, |
float | vecX, | ||
float | vecY, | ||
float | vecZ | ||
) |
Produces a rotation around the vector (vecX,vecY,vecZ).
All graphics drawn after ofRotate is called are rotated. Use ofPushMatrix() and ofPopMatrix() to save and restore the unrotated coordinate system.
- Parameters
-
radians Specifies the angle of rotation, in radians. vecX specifies the x coordinates of a vector vecY specifies the y coordinates of a vector vecZ specifies the z coordinates of a vector
◆ ofRotateX()
void ofRotateX | ( | float | degrees | ) |
◆ ofRotateXDeg()
void ofRotateXDeg | ( | float | degrees | ) |
Produces a rotation around the X-axis of our coordinate system represented by the vector (1,0,0).
- Parameters
-
degrees Specifies the angle of rotation, in degrees.
◆ ofRotateXRad()
void ofRotateXRad | ( | float | radians | ) |
Produces a rotation around the X-axis of our coordinate system represented by the vector (1,0,0).
- Parameters
-
degrees Specifies the angle of rotation, in radians.
◆ ofRotateY()
void ofRotateY | ( | float | degrees | ) |
◆ ofRotateYDeg()
void ofRotateYDeg | ( | float | degrees | ) |
Produces a rotation around the Y-axis of our coordinate system represented by the vector (0,1,0).
- Parameters
-
degrees Specifies the angle of rotation, in degrees.
◆ ofRotateYRad()
void ofRotateYRad | ( | float | radians | ) |
Produces a rotation around the Y-axis of our coordinate system represented by the vector (0,1,0).
- Parameters
-
degrees Specifies the angle of rotation, in radians.
◆ ofRotateZ()
void ofRotateZ | ( | float | degrees | ) |
◆ ofRotateZDeg()
void ofRotateZDeg | ( | float | degrees | ) |
Produces a rotation around the Z-axis of our coordinate system represented by the vector (0,0,1).
- Parameters
-
degrees Specifies the angle of rotation, in degrees.
◆ ofRotateZRad()
void ofRotateZRad | ( | float | radians | ) |
Produces a rotation around the Z-axis of our coordinate system represented by the vector (0,0,1).
- Parameters
-
degrees Specifies the angle of rotation, in radians.
◆ ofScale() [1/3]
void ofScale | ( | const glm::vec3 & | p | ) |
◆ ofScale() [2/3]
void ofScale | ( | float | amount | ) |
Scale along the X, Y and Z axis with the same amount.
◆ ofScale() [3/3]
void ofScale | ( | float | xAmnt, |
float | yAmnt, | ||
float | zAmnt | ||
) |
◆ ofSetBackgroundAuto()
void ofSetBackgroundAuto | ( | bool | bManual | ) |
Sets the background clearing function to be auto (default) or not. If non- auto, then background clearing will not occur per frame (at the start of draw) but rather, whenever ofBackground is called.
◆ ofSetBackgroundColor() [1/3]
void ofSetBackgroundColor | ( | const ofColor & | c | ) |
◆ ofSetBackgroundColor() [2/3]
void ofSetBackgroundColor | ( | int | brightness, |
int | alpha | ||
) |
◆ ofSetBackgroundColor() [3/3]
void ofSetBackgroundColor | ( | int | r, |
int | g, | ||
int | b, | ||
int | a = 255 |
||
) |
Sets the background color. It takes as input r,g,b (0-255). The background is cleared automatically, just before the draw() command, so if the background color is not changing, you could call this inside setup() (once, at the start of the application). If the background color is changing, you can call this inside update().
◆ ofSetBackgroundColorHex()
void ofSetBackgroundColorHex | ( | int | hexColor, |
int | alpha = 255 |
||
) |
Sets the background color using a hex color value.
◆ ofSetCircleResolution()
void ofSetCircleResolution | ( | int | res | ) |
Sets the resolution for the ofDrawCircle command. By default, the circle is 22 points, but if you need to draw larger circles, you can adjust the resolution using this command. All circles are cached in openGL using a display list for optimization purposes.
◆ ofSetColor() [1/5]
void ofSetColor | ( | const ofColor & | color | ) |
◆ ofSetColor() [2/5]
void ofSetColor | ( | const ofColor & | color, |
int | _a | ||
) |
◆ ofSetColor() [3/5]
void ofSetColor | ( | int | gray | ) |
◆ ofSetColor() [4/5]
void ofSetColor | ( | int | r, |
int | g, | ||
int | b | ||
) |
Sets the draw color with r,g,b, 0-255. For example, red would be: ofSetColor(255,0,0). This affects not only the color of shapes drawn with ofDrawRectangle(), ofDrawCircle(), etc, but also the tint of images and textures.
◆ ofSetColor() [5/5]
void ofSetColor | ( | int | r, |
int | g, | ||
int | b, | ||
int | a | ||
) |
Sets the draw color with r,g,b,a 0-255.
For alpha (transparency), you must first enable transparent blending (turned off by default for performance reasons) with ofEnableAlphaBlending()
◆ ofSetCoordHandedness()
void ofSetCoordHandedness | ( | ofHandednessType | handedness | ) |
◆ ofSetCurrentRenderer()
void ofSetCurrentRenderer | ( | shared_ptr< ofBaseRenderer > | renderer, |
bool | setDefaults | ||
) |
◆ ofSetCurveResolution()
void ofSetCurveResolution | ( | int | res | ) |
◆ ofSetDepthTest()
void ofSetDepthTest | ( | bool | depthTest | ) |
Set depth testing on or off to either sort by z-depth (true
) or draw order (false
).
◆ ofSetDrawBitmapMode()
void ofSetDrawBitmapMode | ( | ofDrawBitmapMode | mode | ) |
Set the bitmap drawing mode.
Valid modes:
OF_BITMAPMODE_SCREEN: this is the default mode. It projects the 3d prosition onto the screen so the letters always look the same size but can be positioned in any 3d coordinate.
OF_BITMAPMODE_VIEWPORT: does the same as screen but uses the current viewport instead of the full window if it's different.
OF_BITMAPMODE_MODEL: uses real 3d coordinates so the text will look scaled if it's not in z=0
OF_BITMAPMODE_MODEL_BILLBOARD: uses real 3d coordinates but the text always faces the camera.
OF_BITMAPMODE_SIMPLE: only does 2d and the z coordinate is just disacarded, so if z is not 0 the position in which it'll be drawn will be wrong.
◆ ofSetHexColor()
void ofSetHexColor | ( | int | hexColor | ) |
Sets the draw color with r,g,b, passed in as a hex. Hex is a conventient way to write colors.
◆ ofSetLineWidth()
void ofSetLineWidth | ( | float | lineWidth | ) |
Sets the width of the ofDrawLine() called after.
◆ ofSetMatrixMode()
void ofSetMatrixMode | ( | ofMatrixMode | matrixMode | ) |
◆ ofSetPolyMode()
void ofSetPolyMode | ( | ofPolyWindingMode | mode | ) |
Sets the drawing behavior for overlapping parts of the same polygon.
Possible modes are:
OF_POLY_WINDING_ODD OF_POLY_WINDING_NONZERO OF_POLY_WINDING_POSITIVE OF_POLY_WINDING_NEGATIVE OF_POLY_WINDING_ABS_GEQ_TWO
◆ ofSetRectMode()
void ofSetRectMode | ( | ofRectMode | mode | ) |
Sets the mode for drawing rectangles and other rectangular objects, if they are corner aligned, or drawn so that the x,y position is the center of the rectangle. possible options are OF_RECTMODE_CENTER
and OF_RECTMODE_CORNER
. This affects not only how ofDrawRectangle() objects are drawn, but also ofTexture (and therefore ofImage) objects.
◆ ofSetStyle()
void ofSetStyle | ( | ofStyle | style | ) |
Set the current style of the ofGraphics.
- Parameters
-
style contains information of the graphics style such as ofColor, ofFill, polyMode and others.
- See also
- See ofStyle for more details.
◆ ofSetupGraphicDefaults()
void ofSetupGraphicDefaults | ( | ) |
Resets openGL screen coordinates and values back to OF defaults.
◆ ofSetupScreen()
void ofSetupScreen | ( | ) |
◆ ofSetupScreenOrtho()
void ofSetupScreenOrtho | ( | float | width, |
float | height, | ||
float | nearDist, | ||
float | farDist | ||
) |
◆ ofSetupScreenPerspective()
void ofSetupScreenPerspective | ( | float | width, |
float | height, | ||
float | fov, | ||
float | nearDist, | ||
float | farDist | ||
) |
◆ ofTranslate() [1/3]
void ofTranslate | ( | const glm::vec2 & | p | ) |
◆ ofTranslate() [2/3]
void ofTranslate | ( | const glm::vec3 & | p | ) |
◆ ofTranslate() [3/3]
void ofTranslate | ( | float | x, |
float | y, | ||
float | z = 0 |
||
) |
Translate by (x,y,z) vector of our coordinate system. The call of ofTranslate() modifies graphics positions.
Use ofPushMatrix() and ofPopMatrix() to save and restore the untranslated coordinate system.
◆ ofTriangle() [1/3]
void ofTriangle | ( | const glm::vec3 & | p1, |
const glm::vec3 & | p2, | ||
const glm::vec3 & | p3 | ||
) |
◆ ofTriangle() [2/3]
void ofTriangle | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | x3, | ||
float | y3 | ||
) |
◆ ofTriangle() [3/3]
void ofTriangle | ( | float | x1, |
float | y1, | ||
float | z1, | ||
float | x2, | ||
float | y2, | ||
float | z2, | ||
float | x3, | ||
float | y3, | ||
float | z3 | ||
) |
◆ ofVertex() [1/4]
void ofVertex | ( | const glm::vec2 & | p | ) |
◆ ofVertex() [2/4]
void ofVertex | ( | const glm::vec3 & | p | ) |
◆ ofVertex() [3/4]
void ofVertex | ( | float | x, |
float | y | ||
) |
Specifies a single point of a shape. To be called between ofBeginShape() and ofEndShape().
◆ ofVertex() [4/4]
void ofVertex | ( | float | x, |
float | y, | ||
float | z | ||
) |
◆ ofVertices() [1/4]
void ofVertices | ( | const vector< glm::vec2 > & | polyPoints | ) |
◆ ofVertices() [2/4]
void ofVertices | ( | const vector< glm::vec3 > & | polyPoints | ) |
◆ ofVertices() [3/4]
void ofVertices | ( | const vector< ofVec2f > & | polyPoints | ) |
◆ ofVertices() [4/4]
void ofVertices | ( | const vector< ofVec3f > & | polyPoints | ) |
◆ ofViewport() [1/2]
void ofViewport | ( | float | x = 0 , |
float | y = 0 , |
||
float | width = -1 , |
||
float | height = -1 , |
||
bool | vflip = ofIsVFlipped() |
||
) |
Setup the drawing viewport.
- Parameters
-
x The x position of the viewport y The y position of the viewport width The width of the viewport, defaults to ofGetWidth() height The height of the viewport, defaults to ofGetHeight()
◆ ofViewport() [2/2]
void ofViewport | ( | ofRectangle | viewport | ) |
Setup the drawing viewport.
- Parameters
-
viewport A rectangle describing the size and position of the viewport. If the width or height are set to 0, it will assume the size to be the window size (ofGetWidth(), ofGetHeight())