Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
MasterArbeit
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kai Westerkamp
MasterArbeit
Commits
76ca05b8
Commit
76ca05b8
authored
Jul 10, 2017
by
Adrian Hoppe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
f3db4192
Pipeline
#255
passed with stage
in 22 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
5 deletions
+27
-5
example.pnts
3_PointCloud/example.pnts
+0
-0
main.cpp
3_PointCloud/main.cpp
+27
-5
No files found.
3_PointCloud/example.pnts
View file @
76ca05b8
No preview for this file type
3_PointCloud/main.cpp
View file @
76ca05b8
...
@@ -54,6 +54,7 @@ ICoordinateMapper* mapper; // Converts between depth, color, and 3d coor
...
@@ -54,6 +54,7 @@ ICoordinateMapper* mapper; // Converts between depth, color, and 3d coor
SteamTracking
*
steamTracking
=
nullptr
;
SteamTracking
*
steamTracking
=
nullptr
;
glm
::
mat4x4
*
currentControlerPos
=
nullptr
;
glm
::
mat4x4
*
currentControlerPos
=
nullptr
;
glm
::
mat4x4
controlerToKinect
;
Camera
mainCam
;
Camera
mainCam
;
...
@@ -198,7 +199,7 @@ void processCurrentFrameForExport() {
...
@@ -198,7 +199,7 @@ void processCurrentFrameForExport() {
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
(
glm
::
vec3
(
*
currentControlerPos
*
glm
::
vec4
(
framePositions
[
i
],
1.0
f
)));
points
.
push_back
(
glm
::
vec3
(
*
currentControlerPos
*
controlerToKinect
*
glm
::
vec4
(
framePositions
[
i
],
1.0
f
)));
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
]);
...
@@ -300,6 +301,7 @@ void mainRenderLoop() {
...
@@ -300,6 +301,7 @@ void mainRenderLoop() {
glLoadIdentity
();
glLoadIdentity
();
//rotateCamera(); //todo
//rotateCamera(); //todo
mainCam
.
applyMatrix
();
mainCam
.
applyMatrix
();
//glTranslatef(0.0, 5, 0.0);
glClear
(
GL_COLOR_BUFFER_BIT
|
GL_DEPTH_BUFFER_BIT
);
glClear
(
GL_COLOR_BUFFER_BIT
|
GL_DEPTH_BUFFER_BIT
);
glEnableClientState
(
GL_VERTEX_ARRAY
);
glEnableClientState
(
GL_VERTEX_ARRAY
);
...
@@ -316,18 +318,22 @@ void mainRenderLoop() {
...
@@ -316,18 +318,22 @@ void mainRenderLoop() {
glPushMatrix
();
glPushMatrix
();
//draw current Frame
//draw current Frame
if
(
currentControlerPos
)
//applay controler Transformation
if
(
currentControlerPos
)
{
//applay controler Transformation
glMultMatrixf
(
glm
::
value_ptr
(
controlerToKinect
));
glMultMatrixf
(
glm
::
value_ptr
(
*
currentControlerPos
));
glMultMatrixf
(
glm
::
value_ptr
(
*
currentControlerPos
));
}
glPointSize
(
1.
f
);
glPointSize
(
1.
f
);
drawElementArray
(
framePoints
,
GL_POINTS
);
drawElementArray
(
framePoints
,
GL_POINTS
);
drawElementArray
(
arrowData
,
GL_TRIANGLES
);
drawElementArray
(
arrowData
,
GL_TRIANGLES
);
// draw hud arrow
// draw hud arrow
glTranslatef
(
0.0
f
,
1.5
f
,
0.0
f
);
//
glTranslatef(0.0f, 1.5f, 0.0f);
float
scale
=
1.0
f
;
float
scale
=
0.1
f
;
glScalef
(
scale
,
scale
,
scale
);
glScalef
(
scale
,
scale
,
scale
);
glRotatef
(
-
90
,
0.0
,
1.0
,
0.0
);
glDisableClientState
(
GL_COLOR_ARRAY
);
glDisableClientState
(
GL_COLOR_ARRAY
);
//drawArrow();
//drawArrow();
...
@@ -379,7 +385,7 @@ void mouseMove(int x, int y) {
...
@@ -379,7 +385,7 @@ void mouseMove(int x, int y) {
void
captureNextFrame
(
vr
::
VREvent_t
event
)
void
captureNextFrame
(
vr
::
VREvent_t
event
)
{
{
if
(
event
.
trackedDeviceIndex
==
1
&&
event
.
data
.
controller
.
button
==
33
)
{
if
(
event
.
trackedDeviceIndex
==
1
&&
event
.
data
.
controller
.
button
==
33
)
{
std
::
cout
<<
"Ca
turing Frame c
ontroler Button"
<<
std
::
endl
;
std
::
cout
<<
"Ca
pturing Frame C
ontroler Button"
<<
std
::
endl
;
captureFrame
=
true
;
captureFrame
=
true
;
}
}
}
}
...
@@ -416,6 +422,22 @@ int main(int argc, char* argv[]) {
...
@@ -416,6 +422,22 @@ int main(int argc, char* argv[]) {
glMatrixMode
(
GL_MODELVIEW
);
glMatrixMode
(
GL_MODELVIEW
);
glLoadIdentity
();
glLoadIdentity
();
//kienct: https://msdn.microsoft.com/de-de/library/dn785530.aspx
// 1 unit = 1 meter
// z ist nach vorne, y up, x links aka -90 um die y achse gedreht
// The Camera Space origin (x=0, y=0, z=0) is located at the center of the IR sensor on Kinect
//von links 82,5 mm ist origin (siehe bild kinect mesures), kinect v2: 24,9 cm x 6,6 cm x 6,7cm
//
// http://www.opengl-tutorial.org/beginners-tutorials/tutorial-7-model-loading/
//C:\Program Files (x86)\Steam\steamapps\common\SteamVR\resources\rendermodels\vr_controller_vive_1_5
//HKEY_CURRENT_USER/Software/Valve/SteamPath.
controlerToKinect
=
glm
::
translate
(
glm
::
mat4x4
(),
(
glm
::
vec3
(
-
4.0
f
,
4.0
f
,
12.0
f
)
*
0.01
f
));
// Main loop
// Main loop
atexit
(
close
);
atexit
(
close
);
execute
();
execute
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment