Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
OpenFrameworks Essentials
OpenFrameworks Essentials

OpenFrameworks Essentials: Create stunning, interactive openFrameworks-based applications with this fast-paced guide

eBook
$9.99 $25.99
Paperback
$32.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

OpenFrameworks Essentials

Chapter 1. Getting Started with openFrameworks

In this chapter, we will introduce openFrameworks by covering the following topics:

  • What is openFrameworks?
  • Installing openFrameworks
  • Running an openFrameworks example

Finally, we will discuss the video synthesizer project, which we will develop throughout the book.

What is openFrameworks?

openFrameworks is a free, open source C++ framework that is intended to develop real-time projects, which use most modern computing devices' capabilities, such as video, audio, networking, and computer vision.

openFrameworks is developed by Zach Lieberman, Theodore Watson, and Arturo Castro, together with a big openFrameworks community. The current openFrameworks version is 0.8.4.

Its main features are:

  • openFrameworks is a framework for the easy development of real-time applications. All you need to do is implement a number of events, such as starting project and drawing, and openFrameworks will maintain all the stuff behind this, such as creating a graphical window and listening for mouse and keyboard events.
  • Its conception and philosophy is oriented for use in creative and experimental projects. openFrameworks contain many ready-to-use functions and classes to work with 2D and 3D graphics, video, audio, and so on.
  • It's a C++ framework, that is, you will code it using the C++ programming language. Your code will be compiled in native machine code and executed very efficiently. Many algorithms that work slowly when implemented in languages such as Python, Java, or Processing, could work significantly faster when implemented in openFrameworks.
  • openFrameworks is highly extensible. Its extensions are called addons. They are open source and are built by members of the openFrameworks community. Several hundreds of existing addons give you an opportunity to extend your project with the capabilities of various software libraries, popular sensors, and gadgets.
  • openFrameworks is cross-platform—the code you will write can be executed on many popular platforms, including OS X, Windows, Linux, iOS, Android, and Linux ARM devices such as Raspberry Pi.
  • Finally, it has a very friendly and active community. If you get stuck during developing with openFrameworks, you can get help from the openFrameworks forum.

Begin your acquaintance with openFrameworks by visiting and exploring its site openframeworks.cc. It contains a lot of useful information about openFrameworks, including download links, tutorials, documentation, forums, and news.

Installing openFrameworks

To develop projects with openFrameworks, you need to install an Integrated Development Environment (IDE) with the C++ compiler and openFrameworks.

To install them, perform the following steps:

  1. Go to openFrameworks' download page at openframeworks.cc/download.
  2. Find your platform on the page (OS X, Linux, Windows, iOS, Android, or Linux ARM) and select the desired IDE (Xcode, Code::Blocks, Eclipse, or Visual Studio). For developing with iOS, an OS X computer is required. Development on a Linux ARM device is done using the C++ compiler directly, without an IDE.

    Note

    All the IDEs mentioned are free. But, to run your project on an iOS device, you must buy an iOS Developer License from Apple for $99 per year.

  3. Download the openFrameworks archive by clicking on the corresponding link and unzip it.
  4. Click on the corresponding setup guide link and follow the instructions shown for installing and configuring the IDE and openFrameworks. Now you can develop and run your projects in openFrameworks.

    Tip

    Running openFrameworks projects on desktops (Mac OS X, Windows, or Linux) is simpler than on mobiles. So, if you are a novice in C++ or openFrameworks, we recommend that you start to develop your very first openFrameworks project for a desktop OS rather than a mobile one.

    After a while, when you are a little more comfortable with C++ and openFrameworks, you can easily port your project to mobiles, if needed. You will learn how to deploy openFrameworks projects on mobiles and Raspberry Pi in Chapter 8, Deploying the Project on iOS, Android, and Raspberry Pi.

The openFrameworks folder structure

It's time to look inside openFrameworks, so open the openFrameworks folder. It consists of a number of folders and files, as shown in the following screenshot (the screenshot is for OS X, but the folder structure is similar for all other platforms):

The openFrameworks folder structure

openFrameworks' folder structure

The most important folders for us now are apps and examples. The apps folder is the place where your own projects will be stored. The examples folder contains a collection of examples, demonstrating all the aspects of openFrameworks programming. The examples are categorized by topics, including 3D, graphics, sound, and video.

Now, let's run one of the examples.

Running your first example

We would like to introduce one of the funniest openFrameworks examples, which we like a lot. The example captures the images from a webcam and draws it on the screen as a fancy 3D surface, as shown in the following picture:

Running your first example

3D surface generated by an openFrameworks example

This is the meshFromCamera example located in the examples/3d folder.

Tip

This example requires a webcam. If your computer does not have a built-in webcam, and you have no external webcam to connect to, please work with another example, for instance, examples/3d/3DPrimitivesExample.

We cannot run the example immediately after installing openFrameworks. The reason is that openFrameworks examples are distributed as source files only, without executable files that you can run.

To obtain the executable file, we need to build the project, that is, compile its C++ source code to machine code and link it into an executable file. Let's do it and then run the example by performing the following steps:

  1. Open the example folder examples/3d/meshFromCamera.
  2. Find there the file named meshFromCamera.xcodeproj (Xcode project), meshFromCamera.sln (Visual Studio project), or meshFromCamera.workspace (Code::Blocks project).
  3. Double-click on this file, and the meshFromCamera project will open in your IDE.
  4. Build the project by pressing Command + B in Xcode, F7 in Visual Studio, or by clicking on the Build button in Code::Blocks.

    Tip

    For Xcode users

    In the project, there exist several schemes that indicate the part of the project to build and a number of settings for it. Often at first run, the scheme is set to openFrameworks, as shown on the following screenshot:

    Running your first example

    Scheme selector in Xcode

    If so, the compiler builds openFrameworks, but not the project. To resolve the issue, please click on the scheme name. A context menu will appear. Select the meshFromCamera Release scheme there. After this, perform building as described in step 4.

  5. Run the project by clicking on the corresponding button in your IDE (normally, it's depicted as a small triangle, meaning the play symbol). After running, you will see your webcam's image drawn as a distorted 3D surface.
  6. Press Esc to stop the execution.

This example involves several topics, such as capturing frames from the camera, creating 3D surfaces, and texturing them. You will discover these topics in Chapter 4, Working with Raster Graphics – Images, Videos, and Shaders, and Chapter 5, Creating 3D Graphics, and will be able to build similar and even more sophisticated projects easily.

The video synthesizer application

A video synthesizer is an electronic device or a computer program that generates and transforms a video signal in a complex way. Video synthesizers are used for creating live visuals for DJ sets and performances, or serve as a visual part of interactive installations and mobile apps.

Tip

Probably the most famous analog video synthesizer was made by John Whitney in the middle of the twentieth century. Visual effects, obtained with the synthesizer, are demonstrated in his film Catalog (1961). It's worth watching on YouTube.

Throughout the book, we will build our own video synthesizer application. We will start with a simple project in the next chapter and will extend it by adding new features with each new chapter. At the end of the book, we will get a fully-fledged video synthesizer, which reveals many openFrameworks capabilities.

Typically, a video synthesizer consists of several modules—video generators, video players, video effects, and video mixers—connected to each other. Our synthesizer will include all these basic modules and will have the following structure:

  • A 2D image generator that produces pictures made from geometric shapes, (Chapter 2, Creating Your First openFrameworks Project)
  • A graphical user interface (GUI) consisting of sliders and checkboxes (Chapter 3, Adding a GUI and Handling Keyboard Events)
  • A player of image files, video files, and live videos from a camera (Chapter 4, Working with Raster Graphics – Images, Videos, and Shaders)
  • A video mixer that mixes several pictures using additive blending and the kaleidoscope video effect (Chapter 4, Working with Raster Graphics – Images, Videos, and Shaders)
  • A 3D surface generator that renders a textured and deformed sphere in 3D (Chapter 5, Creating 3D Graphics)
  • Various sources for controlling the synthesizer's parameters, such as LFO, sound analysis, text files (Chapter 6, Animating Parameters), networking, and an Arduino device (Chapter 7, Distributed and Physical Computing with Networking and Arduino)

This structure is shown in the following diagram:

The video synthesizer application

The video synthesizer's structure

Additionally, in Chapter 8, Deploying the Project on iOS, Android, and Raspberry Pi, we will see how to deploy the light version of the synthesizer on mobile devices: iOS, Android, and Raspberry Pi. In the last chapter, Chapter 9, Further Resources, we will consider ways to further enhance the synthesizer, get some advice on debugging and optimizing your future openFrameworks projects, and consider additional references on openFrameworks.

The synthesizer created will have quite a lot of GUI controls and control keys. If while working with the book you need a quick reference on some of them, please see Appendix A, Video Synthesizer Reference, where we have collected descriptions and references to all parts of the synthesizer.

For a short description of openFrameworks functions and classes discussed throughout the book, see Appendix B, openFrameworks Quick Reference.

Three reasons to create your own video synthesizer with openFrameworks

Why would you program a video synthesizer with openFrameworks? The reasons are the following:

  • You will get a handy, standalone application that provides you with interactive video wherever you need it (on a stage at your live performance or in your mobile), running on any platforms, and controlled by other programs or devices, such as mobiles or Arduino.
  • Our video synthesizer is exceptionally customizable. By changing just several lines of code, you will get a unique synthesizer. The more you change the code, the more you find that there are no limits to expressing your creative ideas.
  • By splitting the video synthesizer project into parts and then rearranging and adding new parts, you will obtain something different from the video synthesizer. For example, you can construct an interactive installation that transforms users' faces into abstract images. It could even be a mobile 3D drawing application that generates fantastic 3D landscapes. It's worth noting that you can easily incorporate LeapMotion, Kinect, and many other gadgets into your openFrameworks project in order to realize the interactive experience that you want.

Summary

In this chapter, you learned what openFrameworks is, how to install it, and also how to build and run its examples.

In the next chapter, we will create our own openFrameworks project that draws simple 2D graphics.

Left arrow icon Right arrow icon

Description

If you are a programmer, visual artist, or designer with experience in creative coding, and want to use openFrameworks to create fun, stunning, and interactive applications, this is the book for you. Basic knowledge of programming languages, such as C++, Java, Python, or JavaScript, will be enough to proceed with the book.

What you will learn

  • Install openFrameworks and create a new project Generate 2D and 3D graphics Mix images and videos and process them with shaders Add GUI controls and adjust them from external devices and apps using the OSC protocol Control parameters with a timer, Perlin noise, and sound and text files Use the Arduino to control your application Build a video synthesizer project Run your project on iOS, Android, and Raspberry Pi devices

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Apr 23, 2015
Length: 206 pages
Edition : 1st
Language : English
ISBN-13 : 9781784390532
Category :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Apr 23, 2015
Length: 206 pages
Edition : 1st
Language : English
ISBN-13 : 9781784390532
Category :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 136.97
Mastering openFrameworks: Creative Coding Demystified
$48.99
OpenFrameworks Essentials
$32.99
Learning Three.js: The JavaScript 3D Library for WebGL - Second Edition
$54.99
Total $ 136.97 Stars icon
Banner background image

Table of Contents

12 Chapters
1. Getting Started with openFrameworks Chevron down icon Chevron up icon
2. Creating Your First openFrameworks Project Chevron down icon Chevron up icon
3. Adding a GUI and Handling Keyboard Events Chevron down icon Chevron up icon
4. Working with Raster Graphics – Images, Videos, and Shaders Chevron down icon Chevron up icon
5. Creating 3D Graphics Chevron down icon Chevron up icon
6. Animating Parameters Chevron down icon Chevron up icon
7. Distributed and Physical Computing with Networking and Arduino Chevron down icon Chevron up icon
8. Deploying the Project on iOS, Android, and Raspberry Pi Chevron down icon Chevron up icon
9. Further Resources Chevron down icon Chevron up icon
A. Video Synthesizer Reference Chevron down icon Chevron up icon
B. openFrameworks Quick Reference Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.6
(8 Ratings)
5 star 87.5%
4 star 0%
3 star 0%
2 star 12.5%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Amazon Customer Aug 30, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I am not a programmer, though I have a bit of basic programming experience. This book is clear enough so that I can understand it and I can try out all the examples and use them as a basis for my own experiments.
Amazon Verified review Amazon
Yoichi Nagashima Jun 03, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
At first, I again strongly recommend to read the first book of the author "openFrameworks Essentials" for people who want to expand the possibility in designing interactive multimedia. I enjoyed that first book as my first experience about the openFrameworks. And I understood that openFrameworks can realize the same great projects like Max/MSP/jitter or Processing, but the final application is "standard", not as special environments : this is the open source culture, of course.This second book is presented by the author and a video artist. The author Denis Perevalov is a enthusiastic and sincere scientist, and he has collaborated with many artists in many projects. If you search his name in YouTube or in Vineo, you will enjoy many amazing interactive multimedia projects. Though I had thought that the title of this book "Essentials" means the advanced level from the first book, I understand this more thin book is rather practical version for students. The first book is a textbook, and this second book is the manual to develop an exciting "Video Synthesizer" for amazing VJ performance.In Processing website, Arduino website and Raspberry Pi website, there are standard "Tutorial" page for beginners. We are overwhelmed by the texts introducing many knowledges in an orderly manner, and fear that we cannot do anything before we do not master all of them. This is a problem of "text book" generally. On the contrary, this new book presents the "Video Synthesizer Structure" at the beginning. We can overview of the whole project constructed by each modules of openFrameworks, and we can study/test/arrange any part of them in response to our own request.The traditional education in design was "learn, then produce". But 21st-century design education is "producing with study", because we can get huge knowledges/know-hows by Internet and the system works realtime. This culture "Sketching" (Sketching in Hardware) expands by the open source culture in the world. We can be happy all by the open source culture and Internet - this book informs us the happy future in design, I think. I want to recommend with confidence this book to my students and research/design/education communities.
Amazon Verified review Amazon
Cameren Aug 30, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Step by step instructions to create a video synthesizer work really well. Great introduction into openFrameworks.
Amazon Verified review Amazon
Dolores Joya May 13, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book covers a build up of project work which is closer to a real application of the knowledge. Denis covers a lot of the more sought after techniques in this book. I've read Denis Perevalov's first book Mastering openFramewoks: Creative Coding Demystified and was quickly on my feet with OpenFrameworks. I did a little research and discovered he has taught this subject for several years and his teaching style comes through. I would read openFrameworks Essentials to get the feel of building a full project and read Mastering OpenFrameworks for a walk-thru or reference for what OpenFrameworks can do.
Amazon Verified review Amazon
cloud_canvas Aug 08, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I cannot praise this book highly enough. The project you build looks awesome, and the extent they take you to with adding all kinds of common hooks into it (LFOs for modulation, OSC hooks, reading serial values from a microcontroller) are incredibly useful for every type of creative coding project... these are things that I need to do all the time.Make sure to save a zip of your project at the end of Chapter 3 like they tell you to do. Even though it only comprises about 40 pages towards the end of the book, there's a final sprint of executing a diminutive version of the final project on literally every single platform that oF can handle that's exhilarating!This book covers everything it should in the best way possible with the most satisfying result. I am VERY impressed, and I can't wait to tie into the authors' other openFrameworks book.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.