Intro to openFrameworks

Preview:

DESCRIPTION

This workshop was given at FITC Toronto 2012. Most of the details were shared by browsing code and talking together, so there isn't very much "content" in the slides themselves.

Citation preview

Intro to openFrameworks

Overview

Intros from me, and you OF history and inspiration OF structure and syntax Running and modifying the examples Using addons and contributed code Getting started on a project you want to make

Intros

Me http://kylemcdonald.net/ https://twitter.com/#!/kcimc

You Name Experience level What you want to make with OF

Let's go!

Tour de openFrameworksaka

aka

openFrameworks safari

me

A (Rough) History of OF

Pre-2003: ACU library at MIT Inspired Processing via Ben Fry and Casey Reas Golan Levin also studies at MIT, uses ACU to teach

Zach Lieberman studies under Golan Zach can't teach ACU, develops OF

Theo Watson studies under Zach (2004+) Theo does OSX, Zach does Windows

Arturo Castro meets Zach + Theo (2007/8?) Arturo ports to Linux, joins the OF core team

OF lab (Ars Electronica 2008) OF dev conferences (2011 Pittsburgh, 2012 Detroit)

OF Inspiration

Let's check out some awesome OF work! openFrameworks on Vimeo openFrameworks on Flickr openFrameworks on Creative Applications

OF Structure

OF is a bunch of classes and functions that simplify things by reducing the amount of code you have to write

The “core” of OF is in libs/openFrameworks/ A good way to see everything in one place is

the OF reference Some more notes on folder structure

OF Syntax

It's just C++ syntax, except for the “of” prefixes and some other minor conventions

Some great resources for learning C++ at the bottom of the about page

So...

C++ Syntax

<> are for templates, called “generics” in java . (dot operator) is for accessing children of

objects, :: (colon colon) is for classes and namespace access

You don't normally use an “int[] arr;” like in Processing, you have to use a “vector<int> arr;”

Operator overloading means you can use complex types with mathematical notation: for example, ofVec2f

Comparison to other Environments

Cinder has a steeper learning curve, but was created by “real” programmers

Pocode is more like Flash in having a scene graph, where everything is drawn implicitly

Processing is most similar, but the community is more focused on sketches than addons.

Running and Modifying Examples

007 and before, everything is in apps/examples/ and apps/addonsExamples

0071 and after, everything is in examples/ There are a lot more examples online, we're

continually working to bring in more.

Running and Modifying Examples

imageSequenceExample noiseField2dExample videoGrabberExample asciiVideo pointPickerExample ...

Using Addons and Contributed Code

Sometimes people share their entire project! rise and fall perfume-global face++ and feedrdio ...

Using Addons and Contributed Code

Q: Why is openFrameworks amazing? A: ofxAddons

ofxBox2D ofxKinect ofxFft ofxCv ...

Getting Started on a Project / Hacking Together

What project do you want to make? Let's brainstorm about what you need to make it happen.

What techniques do you want to play with? Let's see if there's something out there that you can wrap or use.

Recommended