unofficial introduction of openframeworks
TRANSCRIPT
Unofficial Introduction of openFrameworks
Sadashige Ishida
Who am I?
Name: Sadashige ISHIDAInterests: Math particularly in geometry, physics,
computer graphics, natural languagesPreference: Fun, beautiful, moving >>> Useful, high-
PerformanceAm researching computer graphics for 4 months.Am researching physics-based animation.Don’t have a Twitter account.
Objectives of this slide.
Introduce a beginner-friendly tool “openFrameworks”.
Find people who read papers/books on computer graphics/OpenGL and implement them together.
Motivation: Want to make an animation.Wanna make animations of characters, fluids, etc…
Need to render(draw on a screen).
Pain of rendering.
Can render with OpenGL.
Pain of rendering.
Can render with OpenGL.
Can render.
Pain of rendering.
Can render with OpenGL.
Can render.
Pain of changing the view point…. Computation of matrices…ahh…
Pain of rendering.
Can render with OpenGL.
Can render.
Pain of changing the view point…. Computation of matrices…ahh…
Wanna be free of them…
Pain of rendering.
Can render with OpenGL.
Can render.
Pain of changing the view point…. Computation of matrices…ahh…
Wanna be free of them…
-> openFrameworks
Let’s see a video.https://www.youtube.com/watch?v=6u6IDorMKAs
Seems you can do many things with it.
openFrameworks
openFrameworks
The official site says openFrameworks is an open source C++ toolkit designed to assist the creative process by providing a simple and intuitive framework for experimentation.
openFrameworks
The official site says openFrameworks is an open source C++ toolkit designed to assist the creative process by providing a simple and intuitive framework for experimentation.
…OK.
(Official)openFrameworks can hundleGLEW, GLUT, libtess2 and cairo for graphicsrtAudio, PortAudio, OpenAL and Kiss
FFT or FMOD for audio input, output and analysisFreeTypeFreeType for fontsFreeImage for image saving and loadingQuicktime, GStreamer and videoInput for video
playback and grabbingPoco for a variety of utilitiesOpenCV for computer visionAssimp for 3D model loading
I use openFrameworks for
Visualization of deformation of polygon meshes(a polygon mesh is a collection of triangles).
Implementation of physics based animations e.g. Position-based dynamics[Muller et. al. 2006].
Animation generally.
Features of openFrameworksVery friendly with beginners!Easy.Write in C++.Friendly with IDEs like Xcode and VisualStudio.Need almost no knowledge of OpenGL.
Takes 3 minutes for running a demo.Takes 5 minutes for making your own project.
Just need to follow very kind tutorials.
Quick for running something after download.
Features of openFrameworks
Let’s compile and run a demo “ofBoxExample”.
1. Download and unzip openFrameworks.URL: http://openframeworks.cc/download/
2. [Mac]Open “Path of openFrameworks(have to write your own path)”/examples/3d/ofBoxExample/ofBoxExample.xcodeprojwith Xcode[Windows]Please refer http://openframeworks.cc/setup/vs/(Sorry, a bit more complicated than Mac.)
3. Run or Debug
A demo of openFrameworks
openFrameworks’s nice points(my personal opinion) Very easy to zoom-in/out with mouse operation
<-painful to write this with OpenGL.Easy to make my own projects.No need for Cmake or Makefile ^_^.No need to specify dependencies or linkers^_^.Simple.
Write everything in setup(), update() and draw().Can draw meshes, play music, make animation.According to the official page, can make iPhone apps.
openFrameworks’s week points (my personal opinion)Have to write “pause” by yourself. Doesn’t seem to
provide this function.Have to edit meshes by yourself.
Usage of openFrameworks
Make your own project.Edit ofApp.cpp (and ofApp.h).Done.
openFrameworks’s ofApp.h
In minimum,
class ofApp : public ofBaseApp{ public: void setup();//Called once when it starts. void update(); //Called every time-step to update the state. void draw(); //Called every time-step after update() to draw.
};
Flow of openFrameworks
ofApp::setup()
ofApp::update()
ofApp::draw()
Repeats on every time-step.
How to change the viewpoint with openFrameworksIn minimum,
class ofApp : public ofBaseApp{ public: void setup();//Called once when it starts. void update(); //Called every time-step to update the state. void draw(); //Called every time-step after update() to draw.
ofEasyCam cam; //Camera(something that controls the viewpoint) };
How to change the viewpoint with openFrameworks
In minimum,
void ofApp::draw(){
////Camera starts. cam.begin(); //Write something for drawing. //e.g. Draw a line between (0,0,0) and (1,1,1) int x1=0, y1=0, z1=0, x2=1, y2=1, z2=1; ofLine(x1,y1,z1,x2,y2,z2) //Drawing done.
//Camera ends. cam.end(); }
Then, it gives
Left drag: RotationMouse wheel, right drag:Zoom-in/outWheel-drag: Transition
Touch-pad operation is similar.
Summary of openFrameworksBeginner-friendly.Easy to render.Simple to write everything in setup(),update() or
draw().Plenty of Example. Can make something good by
editing examples.Various applications.
Objectives of this slide.Introduction of openFrameworks.
Find people who read papers/books on computer graphics/OpenGL and implement them together. For a beginner, it is painful to understand and implement a paper.
Can’t follow equations. Can’t understand what are said.How to design classes.Code gets messy.Code-reading is painful too.
I look for people who can struggle with me.Contact me if you are interested.Correction of my poor English is also welcome.
Name:Sadashige ISHIDAE-mail address:sdsgisd[at]gmail.com
End