Commit 8cad1c31 by Kai Westerkamp

camera ++;

parent e5d9244a
......@@ -4,11 +4,25 @@
#include "quaternion_utils.h"
Camera::Camera()
Camera::Camera() : Camera(vec3(10.0f, 5.0f, 0.0f))
{
}
Camera::Camera(vec3 position) : Camera(position, vec3(0.0f, 0.0f, 0.0f)) {
}
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.0f, 1.0f, 0.0f);
......
......@@ -19,10 +19,12 @@ public:
float speed = 0.3f;
float mouseSpeed = 0.005f;
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);
......
......@@ -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.0f, 1.5f, 0.0f);
float scale = 1.0f ;
glScalef(scale, scale, scale);
......
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