Commit d5c9509f by wester

blafu

parent 872479cc
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>D:\Dropbox\Studium\MasterArbeit\3_PointCloud\glm;..\openvr\headers;glew-2.0.0-win32\glew-2.0.0\include;freeglut-MSVC-3.0.0-2.mp\freeglut\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>H:\Repositories\MasterArbeit\3_PointCloud\glm;D:\Dropbox\Studium\MasterArbeit\3_PointCloud\glm;..\openvr\headers;glew-2.0.0-win32\glew-2.0.0\include;freeglut-MSVC-3.0.0-2.mp\freeglut\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>glew-2.0.0-win32\glew-2.0.0\include;SDL-devel-1.2.15-VC\SDL-1.2.15\include;freeglut-MSVC-3.0.0-2.mp\freeglut\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>H:\Repositories\MasterArbeit\3_PointCloud\glm;glew-2.0.0-win32\glew-2.0.0\include;SDL-devel-1.2.15-VC\SDL-1.2.15\include;freeglut-MSVC-3.0.0-2.mp\freeglut\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
......
...@@ -189,13 +189,17 @@ void getKinectData(bool writeFrameInVector) { ...@@ -189,13 +189,17 @@ void getKinectData(bool writeFrameInVector) {
//get controler pos //get controler pos
//frame -> global //frame -> global
points.clear();
colors.clear();
points.reserve(points.capacity() + width*height); points.reserve(points.capacity() + width*height);
colors.reserve(colors.capacity() + width*height); colors.reserve(colors.capacity() + width*height*3);
for(int i = 0; i < width*height; i++) { for(int i = 0; i < snapshotPoints.size(); i++) {
points.push_back(*currentControlerPos * framePositions[i]); points.push_back(*currentControlerPos * snapshotPoints[i]);
colors.push_back(snapshotColors[i]); colors.push_back(snapshotColors[i*3]);
colors.push_back(snapshotColors[i*3+1]);
colors.push_back(snapshotColors[i*3+2]);
} }
...@@ -215,7 +219,10 @@ void getKinectData(bool writeFrameInVector) { ...@@ -215,7 +219,10 @@ void getKinectData(bool writeFrameInVector) {
} }
void writePointCloud() { void writePointCloud() {
if (points.size() == 0) return; if (points.size() == 0) {
std::cout << "No points, scipping File write" << std::endl;
return;
}
pntsHeader header; pntsHeader header;
size_t pointArrayByteSize = points.size() * sizeof(glm::vec3); size_t pointArrayByteSize = points.size() * sizeof(glm::vec3);
...@@ -248,7 +255,7 @@ void rotateCamera() { ...@@ -248,7 +255,7 @@ void rotateCamera() {
double x = radius*sin(angle); double x = radius*sin(angle);
double z = radius*(1-cos(angle)) - radius/2; double z = radius*(1-cos(angle)) - radius/2;
//gluLookAt(x,0,z,0,0,radius/2,0,1,0); gluLookAt(x,0,z,0,0,radius/2,0,1,0);
angle += 0.002; angle += 0.002;
} }
...@@ -298,9 +305,11 @@ void keyPressed(unsigned char key, int x, int y) ...@@ -298,9 +305,11 @@ void keyPressed(unsigned char key, int x, int y)
{ {
switch (key) { switch (key) {
case 'a': case 'a':
std::cout << "Caturing Frame"<< std::endl;
captureFrame = true; captureFrame = true;
break; break;
case 's': case 's':
std::cout << "writing File"<< std::endl;
writeFile = true; writeFile = true;
break; break;
default: default:
......
No preview for this file type
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