Drawing in 2D

Drawing is one of the main capabilities of openFrameworks. Here, we consider the basics of 2D graphics, including drawing geometric primitives, working with colors, and drawing in an offscreen buffer. In this chapter we will cover:

  • Geometric primitives
  • Using ofPoint
  • Coordinate system transformations
  • Colors
  • Using FBO for offscreen drawings
  • Playing with numerical instability
  • Screen grabbing

Codes and executables for Windows, openFrameworks 0.074, Visual Studio Express 2010 C++: Download

Spirals (Playing with numerical instability)

This example draws spiral-like curves using simple drawing algorithm and illustrates effect of numerical instability. Also, it demonstrates how to use offscreen drawing buffer ofFBO and perform screen grabbing: press Space key and the contents of the screen will be saved in file data/screen.png

Spirals

02-2D/06-Spirals

Leave a comment