Is there a way to get coordinates individually from ofVbo?
Coordinates are stored in ofBufferObject.
ofVbo is stored in the graphics card memory so it’s pretty slow to access it’s memory once it’s created or updated. If you want to do that is better to use an ofVboMesh which keeps an extra copy of the vertices in ram and allows you to read them later
I want to obtain the coordinates of the point of kinect V2, but suppose you made vbomesh as below.
vbomesh.getVbo().setVertexBuffer(cameraSpacePointBuffer, 3, sizeof(CameraSpacePoint), 0);
vbomesh.getVbo().setColorBuffer(colorResultBuffer, sizeof(ofVec4f), 0);
At this time, vbomesh itself does not have coordinates, how can we get the coordinates?
Do you know repositories such as concrete samples?
you can map a buffer into ram like:
glm::vec3 * vertices = vbo.getVertexBuffer().map<glm::vec3>(GL_READ_ONLY);
size_t count = vbo.getVertexBuffer().size() / size_of(glm::vec3);
for(int i=0: i<count;i++{
glm::vec3 & v = vertices[i];
}
as i said, this is reading from the gpu memory so it’ll probably be pretty slow.