At last I could figure out how classes work in OpenFrameworks (c++), and the different types of arrays that can be used.
I found a really good tutorial about classes in c++ on the OF wiki, that was very useful. Here it goes:
I also had a problem using arrays, because I wanted to use the resiazable ones and I didn”t know how to do it. Here I found the solution, using vectors:
I don”t know what I will do without these resources…
So, in order to learning how to use these new things, I wanted to do an exercise where I could create new shapes from the previous drawing tool, and be able to modify each one of these new shapes.
This will be very useful for the deveopment of my future thesis.
Here is a video that shows the exercise finished:
And here you can see the code:
The resolution of the shape that is created once the draw is finished can be modified. I mean, the program can create more or less points within the shape. Sometimes it wouldn”t be necessary have a good resolution of the shape and the possibility of putting down the number of points needed for drawing the shape will increase the performance.
The next exercise will be moving these shapes. And later on, this drawing tool will be used as a selection tool working with video.