Commit 3a38eb64 authored by LANOTTE Nicolas's avatar LANOTTE Nicolas
Browse files

Replace index.js

parent b2fc9bcd
Pipeline #5165 passed with stage
in 14 seconds
"use strict"; // good practice - see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode
/*global THREE, Coordinates, document, window, $ */
var camera, scene, renderer;
var cameraControls;
......@@ -9,7 +12,19 @@ var headlight, spotlight;
function fillScene() {
scene = new THREE.Scene();
scene.background = new THREE.Color( 0xcce0ff );
//scene.background = new THREE.Color( 0xcce0ff );
// SKYBOX
scene.background = new THREE.CubeTextureLoader()
.setPath('../skyboxes/')
.load(['posx.jpg','negx.jpg',
'posy.jpg','negy.jpg',
'posz.jpg', 'negz.jpg']);
scene.fog = new THREE.Fog( 0x808080, 2000, 4000 );
// LIGHTS
......@@ -55,23 +70,28 @@ function fillScene() {
createPaint(paint);
scene.add(paint);
}
function createElement(element) {
//var crateTxr = new THREE.TextureLoader().load('../textures/glass.jpg');
var crateTxr = new THREE.TextureLoader().load('/p.jpg');
var bouteille = new THREE.MeshPhongMaterial( { color: 0x0f6512, opacity: 0.4, transparent: true} );
var bouteille = new THREE.MeshPhongMaterial( { color: 0x0f6512, opacity: 0.6, transparent: true} );
//var bouteille = new THREE.MeshPhongMaterial( { color: 0x0f6512, specular:0xffaaaa, envMap: scene.background} );
var vin = new THREE.MeshPhongMaterial( { color: 0x540d1b} );
var whisky = new THREE.MeshPhongMaterial( { color: 0xd7cfca, opacity: 0.4, transparent: true} );
var whisky = new THREE.MeshPhongMaterial( { color: 0xd7cfca, opacity: 0.6, transparent: true} );
var liquide = new THREE.MeshPhongMaterial( { color: 0xd56730} );
var carafe = new THREE.MeshPhongMaterial( { color: 0xd7cfca, opacity: 0.6, transparent: true } );
var pain = new THREE.MeshPhongMaterial( { color: 0xde6317 } );
var carafe = new THREE.MeshPhongMaterial( { color: 0xd7cfca, envMap: scene.background } );
var pain = new THREE.MeshPhongMaterial( { color: 0xde6317, map: crateTxr } );
var assiette = new THREE.MeshPhongMaterial( { color: 0xd0cbc7 } );
var verre = new THREE.MeshPhongMaterial( { color: 0xd7cfca, opacity: 0.4, transparent: true, shininess:100 } );
var verre = new THREE.MeshPhongMaterial( { color: 0xd7cfca, opacity: 0.6, transparent: true, shininess:100 } );
var cylinder, sphere;
var radialSegments = 32;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment