Réajustement de la skybox.
This commit is contained in:
parent
c426c3bb3a
commit
6d29d8a5ae
35
view.cpp
35
view.cpp
|
@ -9,7 +9,7 @@ View::View(Chose* _root)
|
||||||
fogColor[1] = 0.5;
|
fogColor[1] = 0.5;
|
||||||
fogColor[2] = 0.5;
|
fogColor[2] = 0.5;
|
||||||
fogColor[3] = 1.0;
|
fogColor[3] = 1.0;
|
||||||
density = 0.00001;
|
density = 0.000015;
|
||||||
initWindow();
|
initWindow();
|
||||||
mainLoop();
|
mainLoop();
|
||||||
}
|
}
|
||||||
|
@ -92,20 +92,10 @@ void View::displayAxes() {
|
||||||
glEnable(GL_LIGHTING);
|
glEnable(GL_LIGHTING);
|
||||||
}
|
}
|
||||||
|
|
||||||
void View::renderScene(int lastTime, int currentTime) {
|
void View::setSkybox() {
|
||||||
glMatrixMode(GL_MODELVIEW);
|
int z = 40000;
|
||||||
glLoadIdentity();
|
int d = 160000;
|
||||||
|
glDisable(GL_FOG);
|
||||||
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;
|
|
||||||
glDisable(GL_LIGHTING);
|
glDisable(GL_LIGHTING);
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslated(camera.cameraCenter.x,camera.cameraCenter.y,0);
|
glTranslated(camera.cameraCenter.x,camera.cameraCenter.y,0);
|
||||||
|
@ -137,6 +127,21 @@ void View::renderScene(int lastTime, int currentTime) {
|
||||||
glEnd();
|
glEnd();
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
glEnable(GL_LIGHTING);
|
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);
|
glBegin(GL_TRIANGLES);
|
||||||
root->display();
|
root->display();
|
||||||
|
|
3
view.hh
3
view.hh
|
@ -38,7 +38,7 @@ private :
|
||||||
public :
|
public :
|
||||||
Camera camera;
|
Camera camera;
|
||||||
static const int frontFrustum = 1;
|
static const int frontFrustum = 1;
|
||||||
static const int backFrustum = 160000; // 1km
|
static const int backFrustum = 400000; // 1km
|
||||||
private:
|
private:
|
||||||
Lod lod;
|
Lod lod;
|
||||||
GLfloat fogColor[4];
|
GLfloat fogColor[4];
|
||||||
|
@ -57,6 +57,7 @@ public :
|
||||||
|
|
||||||
private :
|
private :
|
||||||
void setLight();
|
void setLight();
|
||||||
|
void setSkybox();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user