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
8cad1c31
Commit
8cad1c31
authored
Jul 09, 2017
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
camera ++;
parent
e5d9244a
Pipeline
#253
passed with stage
in 19 seconds
Changes
3
Pipelines
1
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 @@
...
@@ -4,11 +4,25 @@
#include "quaternion_utils.h"
#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);
// rotation = glm::gtx::quaternion::angleAxis(degrees(45), RotationAxis);
position
=
glm
::
vec3
(
20
,
10
,
0
);
this
->
position
=
position
;
//direction = normalize(-position);
vec3
dir
=
normalize
(
lookAt
-
position
);
verticalAngle
=
asinf
(
dir
.
y
);
horizontalAngle
=
atan2
(
dir
.
x
,
dir
.
z
);
rotate
(
0
,
0
);
//sets direction
rotate
(
0
,
0
);
//sets direction
up
=
glm
::
vec3
(
0.0
f
,
1.0
f
,
0.0
f
);
up
=
glm
::
vec3
(
0.0
f
,
1.0
f
,
0.0
f
);
...
...
3_PointCloud/Camera.h
View file @
8cad1c31
...
@@ -19,10 +19,12 @@ public:
...
@@ -19,10 +19,12 @@ public:
float
speed
=
0
.
3
f
;
float
speed
=
0
.
3
f
;
float
mouseSpeed
=
0
.
005
f
;
float
mouseSpeed
=
0
.
005
f
;
float
horizontalAngle
=
-
M_PI
/
2
;
float
horizontalAngle
=
(
float
)
-
M_PI
/
2
;
float
verticalAngle
=
-
M_PI
/
8
;
float
verticalAngle
=
(
float
)
-
M_PI
/
8
;
Camera
();
Camera
();
Camera
(
glm
::
vec3
position
);
Camera
(
glm
::
vec3
position
,
glm
::
vec3
lookAt
);
~
Camera
();
~
Camera
();
void
move
(
glm
::
vec3
relative
);
void
move
(
glm
::
vec3
relative
);
...
...
3_PointCloud/main.cpp
View file @
8cad1c31
...
@@ -310,6 +310,9 @@ void mainRenderLoop() {
...
@@ -310,6 +310,9 @@ void mainRenderLoop() {
//draw stored Point cloud
//draw stored Point cloud
drawElementArray
(
exportData
,
GL_POINTS
);
glPushMatrix
();
//draw current Frame
//draw current Frame
if
(
currentControlerPos
)
//applay controler Transformation
if
(
currentControlerPos
)
//applay controler Transformation
glMultMatrixf
(
glm
::
value_ptr
(
*
currentControlerPos
));
glMultMatrixf
(
glm
::
value_ptr
(
*
currentControlerPos
));
...
@@ -317,15 +320,9 @@ void mainRenderLoop() {
...
@@ -317,15 +320,9 @@ 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
);
// draw hud arrow
// draw hud arrow
glPushMatrix
();
glTranslatef
(
0.0
f
,
1.5
f
,
0.0
f
);
glTranslatef
(
0.0
f
,
1.5
f
,
0.0
f
);
float
scale
=
1.0
f
;
float
scale
=
1.0
f
;
glScalef
(
scale
,
scale
,
scale
);
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