I want to draw several circles "along a circle"
(like the example https://www.libcinder.org/docs/guides/opengl/part1.html (chapter Transformations)) and several lines between them. It is supposed to be a very simple graph layout algorithm.
in the example they generate a fixed amount of circles and Batch->draw() them.
I can not really do that since circles will be added, removed and so on.
This is what i tried to do (I guess i am used to general c++ logic):
- Ideally i would want a vector of my nodes.
- generate a vector of circle objects (+ properties) and store those in a vector.
- generate a vector Batch of references to the circle objects in the vector.
- just call draw(),update() whatever and iteratively call Batch[i]->draw() over the vector.
what works is directly storing refs to circles in a vector.
Batch.push_back(gl::Batch::create( circle, shader ));
what i can not get to work is referencing the circles in the circle-vector (last line):
Batch.push_back(gl::Batch::create( Nodes[i], shader ));
The approach is flawed but how do i do this elegantly?
I guess there is a propper way to solve such a situation.
Any help appreciated.