Commit e5d9244a by Kai Westerkamp

capturing FrameSourceTypes_Color

parent 2c11e009
Pipeline #252 passed with stage
in 20 seconds
...@@ -194,20 +194,19 @@ void getKinectData() { ...@@ -194,20 +194,19 @@ void getKinectData() {
} }
void processCurrentFrameForExport() { void processCurrentFrameForExport() {
points.clear();
colors.clear();
points.reserve(points.size() + width*height); points.reserve(points.size() + width*height);
colors.reserve(colors.size() + width*height * 3); colors.reserve(colors.size() + width*height * 3);
for (unsigned int i = 0; i < width*height; i++) { for (unsigned int i = 0; i < width*height; i++) {
if (frameValidPoints[i]) { if (frameValidPoints[i]) {
points.push_back(*currentControlerPos * glm::vec4(framePositions[i], 1.0f)); points.push_back(glm::vec3(*currentControlerPos * glm::vec4(framePositions[i], 1.0f)));
colors.push_back(frameColors[i * 3]); colors.push_back(frameColors[i * 3]);
colors.push_back(frameColors[i * 3 + 1]); colors.push_back(frameColors[i * 3 + 1]);
colors.push_back(frameColors[i * 3 + 2]); colors.push_back(frameColors[i * 3 + 2]);
} }
} }
//update Buffers //update Buffers
if (points.size() == 0) return;
glBindBuffer(GL_ARRAY_BUFFER, exportData.vboID); glBindBuffer(GL_ARRAY_BUFFER, exportData.vboID);
glBufferData(GL_ARRAY_BUFFER, points.size() * sizeof(glm::vec3), &points[0], GL_DYNAMIC_DRAW); glBufferData(GL_ARRAY_BUFFER, points.size() * sizeof(glm::vec3), &points[0], GL_DYNAMIC_DRAW);
...@@ -318,6 +317,10 @@ void mainRenderLoop() { ...@@ -318,6 +317,10 @@ void mainRenderLoop() {
glPointSize(1.f); glPointSize(1.f);
drawElementArray(framePoints, GL_POINTS); drawElementArray(framePoints, GL_POINTS);
drawElementArray(exportData, GL_POINTS);
drawElementArray(arrowData, GL_TRIANGLES); drawElementArray(arrowData, GL_TRIANGLES);
...@@ -451,6 +454,7 @@ void setupFrameBuffer() ...@@ -451,6 +454,7 @@ void setupFrameBuffer()
*fcolor++ = (unsigned char)(1.0 * i / width * 255); *fcolor++ = (unsigned char)(1.0 * i / width * 255);
*fcolor++ = (unsigned char)(1.0 * j / height * 255); *fcolor++ = (unsigned char)(1.0 * j / height * 255);
*fcolor++ = 0; *fcolor++ = 0;
frameValidPoints[i + width*j] = true;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment