-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2010 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
#include <cmath>
#include <msp/core/application.h>
#include <msp/fs/utils.h>
-#include <msp/gbase/simplewindow.h>
+#include <msp/graphics/simplewindow.h>
#include <msp/gl/blend.h>
#include <msp/gl/camera.h>
#include <msp/gl/framebuffer.h>
lighting.attach(0, light);
camera.set_up_direction(GL::Vector3(0, 0, 1));
- camera.set_position(GL::Vector3(distance, 0, 0));
- camera.look_at(GL::Vector3(0, 0, 0));
+ update_camera();
}
Viewer::~Viewer()
float cp = cos(pitch);
float sp = sin(pitch);
camera.set_position(GL::Vector3(-cy*cp*distance, -sy*cp*distance, -sp*distance));
+ camera.set_depth_clip(distance*0.02, distance*50);
camera.look_at(GL::Vector3(0, 0, 0));
}
float sy = sin(light_yaw);
float cp = cos(light_pitch);
float sp = sin(light_pitch);
- light.set_position(GL::Vector4(-cy*cp, -sy*cp, -sp));
+ light.set_position(GL::Vector4(-cy*cp, -sy*cp, -sp, 0));
}