3. If you ever feel overwhelmed with
information, feel free to say
4. If you ever feel overwhelmed with
information, feel free to say
“Just tell me what to type.”
5. If you ever feel overwhelmed with
information, feel free to say
“Just tell me what to type.”
If you ever want to know more or know
why, feel free to say
6. If you ever feel overwhelmed with
information, feel free to say
“Just tell me what to type.”
If you ever want to know more or know
why, feel free to say
“I want to know more.”
8. • How is openFrameworks different from
Processing?
• The structure of oF.
• Basic C++ concepts to get you going.
• Create a new openFrameworks application.
• Add your own variables and functions.
10. Code You’ve Instructions for
Written ? Computer
Compiler Executable Program
+ (e.g. .exe or .app)
Linker
+
Loader
11. Interactive
Development
Environment (IDE)
Code You’ve Instructions for
Written ? Computer
Compiler Executable Program
+ (e.g. .exe or .app)
Linker
+
Loader
12. An IDE like Processing or
Arduino includes
• text editor
• compiler and linker
• other tools to help you
22. 2 tbsp olive oil or sun-dried tomato oil from
the jar 1 tsp dried oregano or a small handful of
fresh leaves, chopped
6 rashers of smoked streaky bacon,
chopped 1 tsp dried thyme or a small handful of
fresh leaves, chopped
2 large onions, chopped
Drizzle balsamic vinegar
3 garlic cloves, crushed
12-14 sun-dried tomato halves, in oil
1kg/2¼lb lean minced beef
Salt and freshly ground black pepper
2 large glasses of red wine
A good handful of fresh basil leaves, torn
2x400g cans chopped tomatoes into small pieces
1x290g jar antipasti marinated mushrooms, 800g-1kg/1¾-2¼lb dried spaghetti
drained
Lots of freshly grated parmesan, to serve
2 fresh or dried bay leaves
1. Heat the oil in a large, heavy-based saucepan and fry the bacon until golden over a medium heat. Add the
onions and garlic, frying until softened. Increase the heat and add the minced beef. Fry it until it has
browned, breaking down any chunks of meat with a wooden spoon. Pour in the wine and boil until it has
reduced in volume by about a third. Reduce the temperature and stir in the tomatoes, drained
mushrooms, bay leaves, oregano, thyme and balsamic vinegar.
2. Either blitz the sun-dried tomatoes in a small blender with a little of the oil to loosen, or just finely chop
before adding to the pan. Season well with salt and pepper. Cover with a lid and simmer the Bolognese
sauce over a gentle heat for 1-1½ hours until it's rich and thickened, stirring occasionally. At the end of
the cooking time, stir in the basil and add any extra seasoning if necessary.
3. Remove from the heat to 'settle' while you cook the spaghetti in plenty of boiling salted water (for the time
stated on the packet). Drain and divide between warmed plates. Scatter a little parmesan over the
spaghetti before adding a good ladleful of the Bolognese sauce, finishing with a scattering of more cheese
and a twist of black
http://www.bbc.co.uk/food/recipes/spaghettibolognese_67868
23. 2 tbsp olive oil or sun-dried tomato oil from
the jar 1 tsp dried oregano or a small handful of
fresh leaves, chopped
6 rashers of smoked streaky bacon,
chopped 1 tsp dried thyme or a small handful of
fresh leaves, chopped
2 large onions, chopped
Drizzle balsamic vinegar
3 garlic cloves, crushed
12-14 sun-dried tomato halves, in oil
1kg/2¼lb lean minced beef
Salt and freshly ground black pepper
2 large glasses of red wine
A good handful of fresh basil leaves, torn
2x400g cans chopped tomatoes into small pieces
1x290g jar antipasti marinated mushrooms, 800g-1kg/1¾-2¼lb dried spaghetti
drained
Lots of freshly grated parmesan, to serve
2 fresh or dried bay leaves
1. Heat the oil in a large, heavy-based saucepan and fry the bacon until golden over a medium heat. Add the
onions and garlic, frying until softened. Increase the heat and add the minced beef. Fry it until it has
browned, breaking down any chunks of meat with a wooden spoon. Pour in the wine and boil until it has
reduced in volume by about a third. Reduce the temperature and stir in the tomatoes, drained
mushrooms, bay leaves, oregano, thyme and balsamic vinegar.
2. Either blitz the sun-dried tomatoes in a small blender with a little of the oil to loosen, or just finely chop
before adding to the pan. Season well with salt and pepper. Cover with a lid and simmer the Bolognese
sauce over a gentle heat for 1-1½ hours until it's rich and thickened, stirring occasionally. At the end of
the cooking time, stir in the basil and add any extra seasoning if necessary.
3. Remove from the heat to 'settle' while you cook the spaghetti in plenty of boiling salted water (for the time
stated on the packet). Drain and divide between warmed plates. Scatter a little parmesan over the
spaghetti before adding a good ladleful of the Bolognese sauce, finishing with a scattering of more cheese
and a twist of black
http://www.bbc.co.uk/food/recipes/spaghettibolognese_67868
24. 2 tbsp olive oil or sun-dried tomato oil from
the jar 1 tsp dried oregano or a small handful of
fresh leaves, chopped
6 rashers of smoked streaky bacon,
chopped 1 tsp dried thyme or a small handful of
fresh leaves, chopped
2 large onions, chopped
Drizzle balsamic vinegar
3 garlic cloves, crushed
12-14 sun-dried tomato halves, in oil
1kg/2¼lb lean minced beef
Salt and freshly ground black pepper
2 large glasses of red wine
A good handful of fresh basil leaves, torn
2x400g cans chopped tomatoes into small pieces
1x290g jar antipasti marinated mushrooms, 800g-1kg/1¾-2¼lb dried spaghetti
drained
Lots of freshly grated parmesan, to serve
2 fresh or dried bay leaves
1. Heat the oil in a large, heavy-based saucepan and fry the bacon until golden over a medium heat. Add the
onions and garlic, frying until softened. Increase the heat and add the minced beef. Fry it until it has
browned, breaking down any chunks of meat with a wooden spoon. Pour in the wine and boil until it has
reduced in volume by about a third. Reduce the temperature and stir in the tomatoes, drained
mushrooms, bay leaves, oregano, thyme and balsamic vinegar.
2. Either blitz the sun-dried tomatoes in a small blender with a little of the oil to loosen, or just finely chop
before adding to the pan. Season well with salt and pepper. Cover with a lid and simmer the Bolognese
sauce over a gentle heat for 1-1½ hours until it's rich and thickened, stirring occasionally. At the end of
the cooking time, stir in the basil and add any extra seasoning if necessary.
3. Remove from the heat to 'settle' while you cook the spaghetti in plenty of boiling salted water (for the time
stated on the packet). Drain and divide between warmed plates. Scatter a little parmesan over the
spaghetti before adding a good ladleful of the Bolognese sauce, finishing with a scattering of more cheese
and a twist of black
http://www.bbc.co.uk/food/recipes/spaghettibolognese_67868
25. 2 tbsp olive oil or sun-dried tomato oil from
1 tsp dried oregano or a small handful of
the jar
6 rashers of smoked streaky bacon,
We would be very irritated if
fresh leaves, chopped
chopped there was an ingredient needed,
1 tsp dried thyme or a small handful of
fresh leaves, chopped
2 large onions, chopped
3 garlic cloves, crushed that wasn’t included here.
Drizzle balsamic vinegar
12-14 sun-dried tomato halves, in oil
1kg/2¼lb lean minced beef
Salt and freshly ground black pepper
2 large glasses of red wine
A good handful of fresh basil leaves, torn
2x400g cans chopped tomatoes into small pieces
1x290g jar antipasti marinated mushrooms, 800g-1kg/1¾-2¼lb dried spaghetti
drained
Lots of freshly grated parmesan, to serve
2 fresh or dried bay leaves
1. Heat the oil in a large, heavy-based saucepan and fry the bacon until golden over a medium heat. Add the
onions and garlic, frying until softened. Increase the heat and add the minced beef. Fry it until it has
browned, breaking down any chunks of meat with a wooden spoon. Pour in the wine and boil until it has
reduced in volume by about a third. Reduce the temperature and stir in the tomatoes, drained
mushrooms, bay leaves, oregano, thyme and balsamic vinegar.
2. Either blitz the sun-dried tomatoes in a small blender with a little of the oil to loosen, or just finely chop
before adding to the pan. Season well with salt and pepper. Cover with a lid and simmer the Bolognese
sauce over a gentle heat for 1-1½ hours until it's rich and thickened, stirring occasionally. At the end of
the cooking time, stir in the basil and add any extra seasoning if necessary.
3. Remove from the heat to 'settle' while you cook the spaghetti in plenty of boiling salted water (for the time
stated on the packet). Drain and divide between warmed plates. Scatter a little parmesan over the
spaghetti before adding a good ladleful of the Bolognese sauce, finishing with a scattering of more cheese
and a twist of black
http://www.bbc.co.uk/food/recipes/spaghettibolognese_67868
26. 2 tbsp olive oil or sun-dried tomato oil from
1 tsp dried oregano or a small handful of
the jar
6 rashers of smoked streaky bacon,
We would be very irritated if
fresh leaves, chopped
chopped there was an ingredient needed,
1 tsp dried thyme or a small handful of
fresh leaves, chopped
2 large onions, chopped
3 garlic cloves, crushed that wasn’t included here.
Drizzle balsamic vinegar
12-14 sun-dried tomato halves, in oil
1kg/2¼lb lean minced beef
The units used to describe the amount
2 large glasses of red wine
Salt and freshly ground black pepper
A good handful of fresh basil leaves, torn
of the ingredients varies according to
2x400g cans chopped tomatoes
1x290g jar antipasti marinated mushrooms,
into small pieces
800g-1kg/1¾-2¼lb dried spaghetti
the culture of the person cooking.
drained
Lots of freshly grated parmesan, to serve
2 fresh or dried bay leaves
1. Heat the oil in a large, heavy-based saucepan and fry the bacon until golden over a medium heat. Add the
onions and garlic, frying until softened. Increase the heat and add the minced beef. Fry it until it has
browned, breaking down any chunks of meat with a wooden spoon. Pour in the wine and boil until it has
reduced in volume by about a third. Reduce the temperature and stir in the tomatoes, drained
mushrooms, bay leaves, oregano, thyme and balsamic vinegar.
2. Either blitz the sun-dried tomatoes in a small blender with a little of the oil to loosen, or just finely chop
before adding to the pan. Season well with salt and pepper. Cover with a lid and simmer the Bolognese
sauce over a gentle heat for 1-1½ hours until it's rich and thickened, stirring occasionally. At the end of
the cooking time, stir in the basil and add any extra seasoning if necessary.
3. Remove from the heat to 'settle' while you cook the spaghetti in plenty of boiling salted water (for the time
stated on the packet). Drain and divide between warmed plates. Scatter a little parmesan over the
spaghetti before adding a good ladleful of the Bolognese sauce, finishing with a scattering of more cheese
and a twist of black
http://www.bbc.co.uk/food/recipes/spaghettibolognese_67868
27. 2 tbsp olive oil or sun-dried tomato oil from
1 tsp dried oregano or a small handful of
the jar
6 rashers of smoked streaky bacon,
We would be very irritated if
fresh leaves, chopped
chopped there was an ingredient needed,
1 tsp dried thyme or a small handful of
fresh leaves, chopped
2 large onions, chopped
3 garlic cloves, crushed that wasn’t included here.
Drizzle balsamic vinegar
12-14 sun-dried tomato halves, in oil
1kg/2¼lb lean minced beef
The units used to describe the amount
2 large glasses of red wine
Salt and freshly ground black pepper
A good handful of fresh basil leaves, torn
of the ingredients varies according to
2x400g cans chopped tomatoes
1x290g jar antipasti marinated mushrooms,
into small pieces
800g-1kg/1¾-2¼lb dried spaghetti
the culture of the person cooking.
drained
Lots of freshly grated parmesan, to serve
2 fresh or dried bay leaves
1. Heat the oil in a large, heavy-based saucepan and fry the bacon until golden over a medium heat. Add the
onions and garlic, frying until softened. Increase the heat and add the minced beef. Fry it until it has
browned, breaking down any chunks of meat with a wooden spoon. Pour in the wine and boil until it has
reduced in volume by about a third. Reduce the temperature and stir in the tomatoes, drained
It’s easier to follow the directions when
mushrooms, bay leaves, oregano, thyme and balsamic vinegar.
you don’t have to list the amounts of
2. Either blitz the sun-dried tomatoes in a small blender with a little of the oil to loosen, or just finely chop
before adding to the pan. Season well with salt and pepper. Cover with a lid and simmer the Bolognese
ingredients within the directions.
sauce over a gentle heat for 1-1½ hours until it's rich and thickened, stirring occasionally. At the end of
the cooking time, stir in the basil and add any extra seasoning if necessary.
3. Remove from the heat to 'settle' while you cook the spaghetti in plenty of boiling salted water (for the time
stated on the packet). Drain and divide between warmed plates. Scatter a little parmesan over the
spaghetti before adding a good ladleful of the Bolognese sauce, finishing with a scattering of more cheese
and a twist of black
http://www.bbc.co.uk/food/recipes/spaghettibolognese_67868
28. Processing
float x;
float y;
float width;
float height;
x = 150;
y = 100;
width = 90;
height = 80;
ellipse(x, y, width, height);
29. Processing
float x;
float y; ingredients or variables
float width;
float height;
x = 150;
y = 100;
width = 90;
height = 80;
ellipse(x, y, width, height);
30. Processing
float x;
float y; ingredients or variables
float width;
float height;
x = 150;
y = 100;
width = 90; directions or algorithm
height = 80;
ellipse(x, y, width, height);
31. Processing
data type
float x;
float y; ingredients or variables
float width;
float height;
x = 150;
y = 100;
width = 90; directions or algorithm
height = 80;
ellipse(x, y, width, height);
32. Processing
data type variable name
float x;
float y; ingredients or variables
float width;
float height;
x = 150;
y = 100;
width = 90; directions or algorithm
height = 80;
ellipse(x, y, width, height);
33. Declaration vs Initialisation
As in a recipe, ingredients need
to be listed at the top so you
know what to buy.
In code, it’s so the compiler
knows how much memory to
reserve. This is called declaring.
34. Declaration vs Initialisation
As in a recipe, ingredients need
to be listed at the top so you
know what to buy.
In code, it’s so the compiler
knows how much memory to
reserve. This is called declaring.
int myInt;
Reserve space for
an int
35. Declaration vs Initialisation
As in a recipe, ingredients need We don’t have to know what
to be listed at the top so you value will be stored in myInt
know what to buy. right away.
In code, it’s so the compiler We can choose a value later.
knows how much memory to This is called initialising.
reserve. This is called declaring.
int myInt;
Reserve space for
an int
36. Declaration vs Initialisation
As in a recipe, ingredients need We don’t have to know what
to be listed at the top so you value will be stored in myInt
know what to buy. right away.
In code, it’s so the compiler We can choose a value later.
knows how much memory to This is called initialising.
reserve. This is called declaring.
int myInt; myInt = 15;
Reserve space for Store the value 15 in the
an int space reserved for myInt
15
37. Need to declare before or at the same time
as initialisation.
38. Need to declare before or at the same time
as initialisation.
myInt = 3;
int myInt;
39. Need to declare before or at the same time
as initialisation.
myInt = 3; int myInt;
int myInt; myInt = 3;
40. Need to declare before or at the same time
as initialisation.
myInt = 3; int myInt;
int myInt; myInt = 3;
Can’t use a variable before it is initialised.
41. Need to declare before or at the same time
as initialisation.
myInt = 3; int myInt;
int myInt; myInt = 3;
Can’t use a variable before it is initialised.
int myInt;
myInt = myInt + 7;
42. Need to declare before or at the same time
as initialisation.
myInt = 3; int myInt;
int myInt; myInt = 3;
Can’t use a variable before it is initialised.
int myInt; int myInt = 3;
myInt = myInt + 7; myInt = myInt + 7;
43. To create a variable
1.Decide what the data type should be.
float
int
char
44. To create a variable
1.Decide what the data type should be.
to create a float type
float
int
char
45. To create a variable
1.Decide what the data type should be.
to create a float type
float
to create an int type int
char
46. To create a variable
1.Decide what the data type should be.
to create a float type
float
to create an int type int
to create a char type char
47. To create a variable
1.Decide what the data type should be.
to create a float type
float
to create an int type int
to create a char type char
2.Decide on a name for your variable. Remember the rules.
48. To create a variable
1.Decide what the data type should be.
to create a float type
float
to create an int type int
to create a char type char
2.Decide on a name for your variable. Remember the rules.
float scale;
int redValue;
char finalMark;
49. To create a variable
1.Decide what the data type should be.
to create a float type
float
to create an int type int
to create a char type char
2.Decide on a name for your variable. Remember the rules.
float scale; you get to choose
int redValue; the name
char finalMark;
50. To create a variable
1.Decide what the data type should be.
to create a float type
float
to create an int type int
to create a char type char
2.Decide on a name for your variable. Remember the rules.
float scale; you get to choose
int redValue; the name
char finalMark;
3.If you already know what the value of that variable is, then go ahead
and set the value.
51. To create a variable
1.Decide what the data type should be.
to create a float type
float
to create an int type int
to create a char type char
2.Decide on a name for your variable. Remember the rules.
float scale; you get to choose
int redValue; the name
char finalMark;
3.If you already know what the value of that variable is, then go ahead
and set the value.
float scale = 0.5;
int redValue = 199;
char finalMark = ‘B’;
52. To create a variable
1.Decide what the data type should be.
to create a float type
float
to create an int type int
to create a char type char
2.Decide on a name for your variable. Remember the rules.
float scale; you get to choose
int redValue; the name
char finalMark;
3.If you already know what the value of that variable is, then go ahead
and set the value. if you don’t know the
float scale = 0.5; value yet, stop at step 2.
int redValue = 199; but remember to end
char finalMark = ‘B’; each line with a ;
53. In Processing, the declarations are at the top
of the file.
In openFrameworks, the declarations are in a
separate file (testApp.h, the header file).
This file is included in main.cpp.
55. Every program has a main function.
It’s the starting point.
It’s hidden in Processing, but exposed in
openFrameworks in main.cpp.
Defines:
the window size
ofAppGlutWindow window;
ofSetupOpenGL(&window, 1024,768, OF_WINDOW);
and your application class
ofRunApp( new testApp());
56. Exercise
Create a copy of emptyExample in your myapps folder.
Rename the folder and .xcodeproj file.
Open the project.
Rename the target.
Make sure it builds and runs.
58. • Really similar functionality as Processing.
• Fully documented here:
• http://www.openframeworks.cc/documentation
59. Exercise
Open your new empty project.
Create a purple circle in the center of the window.
Move the center of the circle to where you click
within the window.
60. Why do I use oF over
Processing?
• Speed
• Accessibility of low level information
• Debugger
• C++
• Version control