commit 6d29d8a5aed5af58cca4de9cb878a261bf11c110
parent c426c3bb3a4fc08e9f03335568895b0c40d1c701
Author: Yoann <yoann.b87@voila.fr>
Date: Sat, 14 Jan 2012 15:27:16 +0100
Réajustement de la skybox.
Diffstat:
2 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/view.cpp b/view.cpp
@@ -9,7 +9,7 @@ View::View(Chose* _root)
fogColor[1] = 0.5;
fogColor[2] = 0.5;
fogColor[3] = 1.0;
- density = 0.00001;
+ density = 0.000015;
initWindow();
mainLoop();
}
@@ -92,20 +92,10 @@ void View::displayAxes() {
glEnable(GL_LIGHTING);
}
-void View::renderScene(int lastTime, int currentTime) {
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) ;
-
- camera.animation(currentTime-lastTime);
- camera.setCamera();
- lod.setCamera(camera.cameraCenter);
-
- setLight();
- //displayAxes();
- int z = 40000;
- int d = 70000;
+void View::setSkybox() {
+ int z = 40000;
+ int d = 160000;
+ glDisable(GL_FOG);
glDisable(GL_LIGHTING);
glPushMatrix();
glTranslated(camera.cameraCenter.x,camera.cameraCenter.y,0);
@@ -137,6 +127,21 @@ void View::renderScene(int lastTime, int currentTime) {
glEnd();
glPopMatrix();
glEnable(GL_LIGHTING);
+ glEnable(GL_FOG);
+}
+
+void View::renderScene(int lastTime, int currentTime) {
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) ;
+
+ camera.animation(currentTime-lastTime);
+ camera.setCamera();
+ lod.setCamera(camera.cameraCenter);
+
+ setLight();
+ setSkybox();
glBegin(GL_TRIANGLES);
root->display();
diff --git a/view.hh b/view.hh
@@ -38,7 +38,7 @@ private :
public :
Camera camera;
static const int frontFrustum = 1;
- static const int backFrustum = 160000; // 1km
+ static const int backFrustum = 400000; // 1km
private:
Lod lod;
GLfloat fogColor[4];
@@ -57,6 +57,7 @@ public :
private :
void setLight();
+ void setSkybox();
};
#endif