I have a VBO, which i init in the following manner:
- (void)setupVBOs {
GLuint vertexBuffer;
glGenBuffers(1, &vertexBuffer);
glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);
glBufferData(GL_ARRAY_BUFFER, sizeof(Vertices), Vertices, GL_STATIC_DRAW);
GLuint indexBuffer;
glGenBuffers(1, &indexBuffer);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(Indices), Indices, GL_STATIC_DRAW);
}
As you can see, i'm using GL_STATIC_DRAW
, and that is good for static objects which do not change (not including translations and such).
The thing is, i have no idea about where to start when it comes to drawing dynamic objects, which could be changed in a tap gesture or something of that sort.
A good example is this video: example.
It is obvious openGL is being used here, and for every different type of gesture, they manipulate the vertices location.
How is it done? by changing the x y z coordinates on every touch? and is it GL_DYNAMIC_DRAW
they are using?
Hopefully i'm not entering to a world of pain by trying to achieve a similar behaviour.