/*
 * Dessine des spheres avec lumieres et texture bumpmap pour donner un aspect metallique
 * @param {type} dots
 * @param {type} couleurs
 * @returns {undefined}
 */
function draw(dots, couleurs, nb_point, nb_param) {

    var map = THREE.ImageUtils.loadTexture("../img/texture/metal3.jpg");
    var bmap = THREE.ImageUtils.loadTexture("../img/texture/metal3bumpmap.jpg");

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

    var geometry = new THREE.SphereGeometry(20, 20, 20);

    var counter = 0;
    for (var i = 0; i < nb_point; i++) {
        var sphere = new THREE.Mesh(geometry, material);
        sphere.position.x = dots[counter];
        sphere.position.y = dots[counter + 1];
        if(nb_param === 3) {
            sphere.position.z = dots[counter + 2];
        }
        else sphere.position.z = 0;
        group.add(sphere);
        counter += nb_param;
    }

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

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

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

    scene.add(spotLight);

}