I guess it's Peter Daukintis week. :) Today's project he's showing off the openFrameworks.
Reminder about openFrameworks?
openFrameworks is designed to work as a general purpose glue, and wraps together several commonly used libraries, including:
- OpenGL, GLEW, GLUT, libtess2 and cairo for graphics
- rtAudio, PortAudio, OpenAL and Kiss FFT or FMOD for audio input, output and analysis
- FreeType for fonts
- FreeImage for image saving and loading
- Quicktime, GStreamer and videoInput for video playback and grabbing
- Poco for a variety of utilities
- OpenCV for computer vision
- Assimp for 3D model loading
The code is written to be massively cross-compatible. Right now we support five operating systems (Windows, OSX, Linux, iOS, Android) and four IDEs (XCode, Code::Blocks, and Visual Studio and Eclipse). The API is designed to be minimal and easy to grasp.
openFrameworks is distributed under the MIT License. This gives everyone the freedoms to use openFrameworks in any context: commercial or non-commercial, public or private, open or closed source. While many openFrameworks users give their work back to the community in a similarly free way, there is no obligation to contribute.
Simply put, openFrameworks is a tool that makes it much easier to make things with code. We find it super useful, and we hope you do too.
Here are some related posts;
- Cinder, openFrameworks, Kinect for Windows v2 and getting started...
- Kinect 4 Windows V2 & openFrameworks
- Using Kinect for Windows v2 Sensor with openFrameworks in WinRT applications
In my previous post I showed how to get an environment set up with Openframeworks and Kinect V2.0 for Windows Store. I’d like to elaborate on that a little and run through a demo app I recently created. Since these posts are based on the MSOpenTech fork of Ofx which works with Windows Store we are restricted to using OpenGL ES as this is what is currently supported by Project Angle. What this means in practice is that if you find an oFx addon that you want to use you need to make sure that it doesn’t call methods unsupported by OpenGL ES. This includes things like glBegin..glEnd immediate mode rendering syntax – this is replaced with vertex buffer rendering. If an addon has used this style then it can’t be used with Windows Store currently. Another option here would be to create an oFx desktop app with Kinect integration – more on that in a subsequent post…
Anyway, whilst leafing through the interesting addons I could use I found Box2D which is a 2d physics engine which I thought might work well in a demo.
In the build of the oFx project generator that I am using (from the universal branch here https://github.com/MSOpenTech/openFrameworks) the addons feature doesn’t seem to work. To work around this I used a different fork of oFx from here https://github.com/liquidzym/openFrameworks/tree/VS2013 which has support for Visual Studio 2013 and I added the addon and then I copied the entries from the Visual Studio project files across into my Windows Store projects.
Using that method I got Box2D into my app. From there I could define a Box2D world with physical properties and boundaries and I could introduce rigid bodies into the world. I chose to populate the world with differently-coloured circles, I set the boundaries to be the edges of the app and I used the Kinect body data to make my hands attraction points for the circles.
It is mildly amusing to make the circles chase you as you swing your hands around but not difficult to let your imagination run riot thinking about the possibilities here. My demo was put together with a few lines of code – that’s the power of OpenFrameworks and other similar frameworks – they include a host of creative elements without the need to reinvent everything.
Project Information URL: http://peted.azurewebsites.net/openframeworks-kinect-4-windows-v2-ii/
Project Source URL: https://github.com/peted70/kinect-ofx-box2d-circles