public Image drawZBuffer() throws IOException {
        BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
        double denominateur =  abs(zmax - zmin);
        System.out.println("denominateur : "+denominateur);
        for (int y = 0; y < height; y++) {
            for (int x = 0; x < width; x++) {
                double value = model.zbufferAt(x, y);
                assert(value <= zmax):"zbufferAt(x, y) > zmax  : "+value+" > "+zmax;
//                System.out.println("(abs(zmin) + abs(value)) : "+(abs(zmin) + abs(value)));
                double rate = value == -Double.MAX_VALUE ? 0 : (abs(zmin) + abs(value)) / (double)denominateur;
                int intensite = (int) (rate * 255.);
                assert(rate <=1 && rate >=0):"rate incorrect : "+rate;
                Color c = new Color(intensite,intensite,intensite);
//                System.out.println("c : "+c);
                image.setRGB(x, height-1- y, c.getRGB());
            }

        }
        return image;
    }