Unofficial Introduction of openFrameworks

27
Unofficial Introduction of openFrameworks Sadashige Ishida

Transcript of Unofficial Introduction of openFrameworks

Page 1: Unofficial Introduction of openFrameworks

Unofficial Introduction of openFrameworks

Sadashige Ishida

Page 2: Unofficial Introduction of openFrameworks

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.

Page 3: Unofficial Introduction of openFrameworks

Objectives of this slide.

Introduce a beginner-friendly tool “openFrameworks”.

Find people who read papers/books on computer graphics/OpenGL and implement them together.

Page 4: Unofficial Introduction of openFrameworks

Motivation: Want to make an animation.Wanna make animations of characters, fluids, etc…

Need to render(draw on a screen).

Page 5: Unofficial Introduction of openFrameworks

Pain of rendering.

Can render with OpenGL.

Page 6: Unofficial Introduction of openFrameworks

Pain of rendering.

Can render with OpenGL.

Can render.

Page 7: Unofficial Introduction of openFrameworks

Pain of rendering.

Can render with OpenGL.

Can render.

Pain of changing the view point…. Computation of matrices…ahh…

Page 8: Unofficial Introduction of openFrameworks

Pain of rendering.

Can render with OpenGL.

Can render.

Pain of changing the view point…. Computation of matrices…ahh…

Wanna be free of them…

Page 9: Unofficial Introduction of openFrameworks

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

Page 10: Unofficial Introduction of openFrameworks

Let’s see a video.https://www.youtube.com/watch?v=6u6IDorMKAs

Seems you can do many things with it.

openFrameworks

Page 11: Unofficial Introduction of 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.

Page 12: Unofficial Introduction of 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.

…OK.

Page 13: Unofficial Introduction of openFrameworks

(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

Page 14: Unofficial Introduction of openFrameworks

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.

Page 15: Unofficial Introduction of openFrameworks

Features of openFrameworksVery friendly with beginners!Easy.Write in C++.Friendly with IDEs like Xcode and VisualStudio.Need almost no knowledge of OpenGL.

Page 16: Unofficial Introduction of openFrameworks

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

Page 17: Unofficial Introduction 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

Page 18: Unofficial Introduction 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.

Page 19: Unofficial Introduction of openFrameworks

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.

Page 20: Unofficial Introduction of openFrameworks

Usage of openFrameworks

Make your own project.Edit ofApp.cpp (and ofApp.h).Done.

Page 21: Unofficial Introduction of openFrameworks

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.

};

Page 22: Unofficial Introduction of openFrameworks

Flow of openFrameworks

ofApp::setup()

ofApp::update()

ofApp::draw()

Repeats on every time-step.

Page 23: Unofficial Introduction of openFrameworks

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) };

Page 24: Unofficial Introduction of openFrameworks

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.

Page 25: Unofficial Introduction of openFrameworks

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.

Page 26: Unofficial Introduction of openFrameworks

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

Page 27: Unofficial Introduction of openFrameworks

End