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



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s