This repository is a collection of C++ (openFrameworks) code examples for Daniel Shiffman's book the Nature of Code (2024 Edition), ported from his original code examples written in JavaScript (p5.js).
-
Download openFrameworks v0.12.0 for your desired platform (e.g.
osx
for macOS) from the openFrameworks download page and unzip it. You should see a folder titledof_v0.12.0_platform_release/
(e.g.of_v0.12.0_osx_release/
for macOS). -
Download this repository, unzip it, and place the extracted folder (
nature-of-code-2024-openframeworks-main/
) into theof_v0.12.0_platform_release/apps/
folder. -
Launch the projectGenerator app located in the
of_v0.12.0_platform_release/projectGenerator/
folder. Click the gear icon ⚙️ and check Advanced options.
![]() |
![]() |
---|
-
In the projectGenerator app, go to the update multiple tab. Under Update path, click the magnifying glass icon 🔍 and open the repository folder (
nature-of-code-2024-openframeworks-main/
) from there, then Click the Update multiple button. -
Finally, open any code example (e.g.
Example_0_1_Random_Walk/
) in your preferred IDE to compile and run.
For additional guides, you can refer to the openFrameworks learning page.
The code examples in this repository are licensed under the MIT License. For copyright information of the Nature of Code book, please refer to the Nature of Code Credits page.