commit 11f2948558ddf63b8af2c60ae500a6f9329b50d1
parent a418b982eaf78540ac39069f97d408f059cd1d0a
Author: Yoann <yoann.b87@voila.fr>
Date: Fri, 2 Dec 2011 08:21:20 +0100
Correction sur la lumière ambiante.
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/view.cpp b/view.cpp
@@ -6,8 +6,11 @@ View::View(Chose* root) : root(root), camera(Camera(Vertexf(420,468,151),230,108
}
void View::setColor(unsigned char r, unsigned char g, unsigned char b) {
- float MatDif[4] = {r/255.f, g/255.f, b/255.f, 1.0f};
- float MatAmb[4] = {r/500.f, g/500.f, b/500.f, 1.0f};
+ float red = r/255.f;
+ float green = g/255.f;
+ float blue = b/255.f;
+ float MatDif[4] = {red, green, blue, 1.0f};
+ float MatAmb[4] = {red, green, blue, 1.0f};
glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,MatDif);
glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT,MatAmb);
}