Author Archives: efe

Book review: Cinder Creative Coding Cookbook

I cannot deny that I was very excited to check out this title. Not only because it is writing by one of the most creative and technical skilled computational designers nowadays, but to see how a rich and sometimes complex toolkit as Cinder could be presented in a series of ‘recipes’. Even more, how topics such as computer vision, media and simulation engines could be presented on a friendly still in-deep way.

The book targets a broad audience, raging from designers and creative coders to iOS and multimedia developers. However, I have the impression that the reader would profit the most by having a background in Cinder of any the creative coding frameworks available (Processing, OpenFrameWorks, etc.). Familiarity with modern c++ is also advisable as the book makes heavy use of namespaces, containers, generic programming and, in the case of the iOS recipes, some Cocoa Touch concepts (events, etc).

I like the organisation of the book and the way recipes are presented. Each one of the recipes has a very friendly way to present the information helping the reader to understand the why and how of each one of the topics presented. In particular I enjoyed the first chapter where the reader is introduced to the basics of setting up a Cinder application altogether with a detailed description of the functions that make the life cycle of an app.

Rui and Dawid have managed to write a very instructive and concise book. I am looking forward for future contributions to the growing literature in creative coding.

Link:
Cinder cookbook

Book review: Cinder – Begin Creative Coding

Being one of the youngest and most powerful creative coding libraries, Cinder is a complex and elegant toolkit written in C++. Due the professional nature of its implementation, it is also one of the hardest to learn. This book will guide the reader from setting up a basic Cinder project to create graphics using OpenGL and Cairo, create sound playbacks and the use of user events.
Targeted for artists and designers, the book hides all the complex C++ technical details in order to introduce the user to specific topics. Each chapter is precise and concise, addressing specific technical problems with a direct and friendly language. For instance,
Chapter 8 has a nice introduction to 3D and how matrix stacks work. Although a little opaque, the chapter tackles the complex topic of OpenGL in a friendly way.
The book opens with a definition of creative coding and how to setup the library. It also makes a clear distinction between the use Cinder on mac and on windows. Chapter 2 gives a general overview of what the library is capable of doing.
Chapter 3 is an introduction to the development IDE and Cinder native tool ‘TinderBox’.
Chapters 4 to 8 deal with the topic of computer graphics. Chapter 9 and 10 provide a final overview to the use of sound files and events.The book finishes with an useful appendix of the Cinder types, a valuable technical resource for the beginner.
Leaving the reader at the gates of boost, STL, GLSL and elsewhere, this book is an interesting incorporation to the emerging creative c++ coding literature.

I think this book is a starting point for beginners willing to jump into to huge ocean of c++. I would recommend getting along a good c++ and openGL reference, patience to handle the IDE and lot of good will. The experience will pay back!

Link to the book:
Creative Coding with Cinder

Generic study # 2 and vectors

One of the most common bottlenecks I have experienced when porting processing sketches into iOS/OFW is the way to pass vectors into classes. There is a good share of discussion if passing by object, reference or pointer is the best option. The answer to that question relies deeply in the context of the porting and the usability of the whole project.

In my case, I like my good share of vector pointers for my particle/chaos systems. So I decided to write a very small example of how to pass vectors of pointers as references. Notice the huge amount of notes! C++ is a huge jungle so forget about unique ways of reaching a result. You can notice, for instance, that my constructor has a different way to assign the vectors. Also that the function that applies arithmetic to the vector can be called directly from the main loop or from the class itself. Matter of taste. Finally, I declared the class generically (maybe our particles systems might have different types).

#include <iostream>
#include <vector>
#include "PassVector.h"

using namespace std;

int main(int argc, const char * argv[])
{
    vector<int*>randomValuesA;
    vector<int*>randomValuesB;
    
    PassVector<int> mPassVector;
    
    for(unsigned int i=0;i<10;i++){
        randomValuesA.push_back(new int(rand()%100));
        randomValuesB.push_back(new int(rand()%100));
    }
    
    mPassVector = PassVector<int>(randomValuesA,randomValuesB);
    //passing the values from the main loop//////////////////////////////
    //mPassVector.addTheReferences(randomValuesA, randomValuesB);
    mPassVector.addTheReferences();
    
    return 0;
}

The PassVector class. It is generic!

#include <iostream>
#include <vector>

using namespace std;

template <typename T>
class PassVector{
public:
    
    PassVector(){
        
    }
    
    PassVector(vector<T*>&_vecA,vector<T*>&_vecB):vecA(_vecA),vecB(_vecB){
        //if you are more into the java-ish style
        //vecA = _vecA;
        //vecB = _vecB;
    }
    
    ~PassVector(){
        
    }
    
    //create new vectors containing info related with speed, physics and etc
    //you might want to use iterators for calling functions here
    void addTheReferences(){
        for(unsigned int i=0;i<vecA.size();i++){
            addedVectorsAsReferences.push_back(new T(addPoinerValues(vecA[i], vecB[i])));
            cout<<"adding the value "<<*addedVectorsAsReferences[i]<<" at index "<<i<<endl;
        }
    }
    
    /*
     //passing the values directly from the main loop
    void addTheReferences(vector<T*>&v1,vector<T*>&v2){
        for(unsigned int i=0;i<v1.size();i++){
            addedVectorsAsReferences.push_back(new T(addPoinerValues(v1[i], v2[i])));
            cout<<"adding the value "<<*addedVectorsAsReferences[i]<<" at index "<<i<<endl;
        }
    }
     */
    
    //this function for any pointer arithmetic 
    T addPoinerValues(T* x, T* y){
        return *x + *y;//+,/,-, %
    }
    
    vector<T*>vecA;
    vector<T*>vecB;
    //new values
    vector<T*>addedVectorsAsReferences;
    
};

happy coding!

Maison Lumière preview

We are preparing the interactive installation ‘Maison Lumière’ for the Lighthouse Festival at Korzo Theater. So far so good, it has been a very enjoyable process.
The installation allows you to tweet and the letters to be displayed as part of a ‘wind’ moving the letters all over the place. Also you can control the ‘shape’ of the wind with a kinect input that we are still calibrating (hand detection can be really seriously tricky!).
On the visual side, I decided to use scattering light as the installation will be projected over the huge glass gate at the entrance of the theater. We want to provide the metaphor of ‘welcome to the lighthouse’. The ‘leaves’ of the design remind me of origami giving a very childish and playful feeling to it.

Page 1 of 512345