/*
 * Disques plats avec plus de lumiere de couleur choisie
 */
function draw(dots, couleurs, nb_point, nb_param) {


    //le plan
//    var planeGeo = new THREE.PlaneGeometry(500, 500, 50, 50);
//    var planeMaterial = new THREE.MeshPhongMaterial({color: couleurs[0], shininess: 1});
//    var plane = new THREE.Mesh(planeGeo, planeMaterial);
//    plane.position.z = -1;
//    plane.position.y = 100;
//    group.add(plane);

    //param des cercles
//    var radius = 15;
    var segments = 32;
//    var circleGeometry = new THREE.CircleGeometry(radius, segments);

    //image texture map
    var map = THREE.ImageUtils.loadTexture("../img/texture/metal5.jpg");
    var bmap = THREE.ImageUtils.loadTexture("../img/texture/metal5bumpmap.jpg");

    var counter = 0;
    var icouleur = 0; //indice pour le tableau couleurs
    for (var i = 0; i < nb_point; i++) {
        if (icouleur >= couleurs.length) {
            icouleur = 0;
        }
        
        if(nb_param === 3) {
            var z = dots[counter + 2] / 3;
        }
        else {
            var z = 20;
        }
        
        var circleGeometry = new THREE.CircleGeometry(z, segments);

        var material = new THREE.MeshPhongMaterial({
            color: couleurs[icouleur++],
            ambient: 0x030303,
            specular: 0xc0c0c0,
            shininess: 30,
            bumpMap: bmap,
            map: map
        });
        var circle = new THREE.Mesh(circleGeometry, material);

        circle.position.x = dots[counter];
        circle.position.y = dots[counter + 1];
        circle.position.z = 0;

        group.add(circle);
        counter += nb_param;
    }

    //lumiere
//    var directionalLight = new THREE.DirectionalLight(couleurs[0], 1);
//    directionalLight.position.set(0, 0, 0);
//    scene.add(directionalLight);

    var plight1 = new THREE.PointLight(couleurs[0], 1, 0);
    var plight2 = new THREE.PointLight(couleurs[0], 1, 0);
//    plight1.position.set(200, 0, 40);
//    plight2.position.set(-200, 300, 40);
    plight1.position.set(-400, 0, 40);
    plight2.position.set(300, 100, 40);

    scene.add(plight1);
    scene.add(plight2);

//    var light = new THREE.AmbientLight( couleurs[0] );

    var spotLight = new THREE.SpotLight(0xffffff, 6);
    spotLight.position.set(0, 1000, 100);

    scene.add(spotLight);

//    scene.add(light);
}