Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
masterarbeit-kai
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
0
Merge Requests
0
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
Philipp Adolf
masterarbeit-kai
Commits
8cad1c31
Commit
8cad1c31
authored
Jul 09, 2017
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
camera ++;
parent
e5d9244a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
11 deletions
+24
-11
Camera.cpp
3_PointCloud/Camera.cpp
+17
-3
Camera.h
3_PointCloud/Camera.h
+4
-2
main.cpp
3_PointCloud/main.cpp
+3
-6
No files found.
3_PointCloud/Camera.cpp
View file @
8cad1c31
...
...
@@ -4,11 +4,25 @@
#include "quaternion_utils.h"
Camera
::
Camera
()
Camera
::
Camera
()
:
Camera
(
vec3
(
10.0
f
,
5.0
f
,
0.0
f
))
{
}
Camera
::
Camera
(
vec3
position
)
:
Camera
(
position
,
vec3
(
0.0
f
,
0.0
f
,
0.0
f
))
{
}
Camera
::
Camera
(
vec3
position
,
vec3
lookAt
)
{
// rotation = glm::gtx::quaternion::angleAxis(degrees(45), RotationAxis);
position
=
glm
::
vec3
(
20
,
10
,
0
);
//direction = normalize(-position);
this
->
position
=
position
;
vec3
dir
=
normalize
(
lookAt
-
position
);
verticalAngle
=
asinf
(
dir
.
y
);
horizontalAngle
=
atan2
(
dir
.
x
,
dir
.
z
);
rotate
(
0
,
0
);
//sets direction
up
=
glm
::
vec3
(
0.0
f
,
1.0
f
,
0.0
f
);
...
...
3_PointCloud/Camera.h
View file @
8cad1c31
...
...
@@ -19,10 +19,12 @@ public:
float
speed
=
0
.
3
f
;
float
mouseSpeed
=
0
.
005
f
;
float
horizontalAngle
=
-
M_PI
/
2
;
float
verticalAngle
=
-
M_PI
/
8
;
float
horizontalAngle
=
(
float
)
-
M_PI
/
2
;
float
verticalAngle
=
(
float
)
-
M_PI
/
8
;
Camera
();
Camera
(
glm
::
vec3
position
);
Camera
(
glm
::
vec3
position
,
glm
::
vec3
lookAt
);
~
Camera
();
void
move
(
glm
::
vec3
relative
);
...
...
3_PointCloud/main.cpp
View file @
8cad1c31
...
...
@@ -310,6 +310,9 @@ void mainRenderLoop() {
//draw stored Point cloud
drawElementArray
(
exportData
,
GL_POINTS
);
glPushMatrix
();
//draw current Frame
if
(
currentControlerPos
)
//applay controler Transformation
glMultMatrixf
(
glm
::
value_ptr
(
*
currentControlerPos
));
...
...
@@ -317,15 +320,9 @@ void mainRenderLoop() {
glPointSize
(
1.
f
);
drawElementArray
(
framePoints
,
GL_POINTS
);
drawElementArray
(
exportData
,
GL_POINTS
);
drawElementArray
(
arrowData
,
GL_TRIANGLES
);
// draw hud arrow
glPushMatrix
();
glTranslatef
(
0.0
f
,
1.5
f
,
0.0
f
);
float
scale
=
1.0
f
;
glScalef
(
scale
,
scale
,
scale
);
...
...
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