Browse Source

Removed webgl_animation_cloth and webgl_shading_physical examples.

Mr.doob 3 năm trước cách đây
mục cha
commit
a2895bc49e

+ 0 - 2
examples/files.json

@@ -1,6 +1,5 @@
 {
 	"webgl": [
-		"webgl_animation_cloth",
 		"webgl_animation_keyframes",
 		"webgl_animation_skinning_blending",
 		"webgl_animation_skinning_additive_blending",
@@ -206,7 +205,6 @@
 		"webgl_shaders_ocean",
 		"webgl_shaders_sky",
 		"webgl_shaders_tonemapping",
-		"webgl_shading_physical",
 		"webgl_shadow_contact",
 		"webgl_shadowmap",
 		"webgl_shadowmap_performance",

BIN
examples/models/gltf/SittingBox.glb


BIN
examples/screenshots/webgl_animation_cloth.jpg


+ 0 - 2
examples/tags.json

@@ -1,5 +1,4 @@
 {
-	"webgl_animation_cloth": [ "physics", "integration", "shadow" ],
 	"webgl_clipping": [ "solid" ],
 	"webgl_clipping_advanced": [ "solid" ],
 	"webgl_clipping_intersection": [ "solid" ],
@@ -65,7 +64,6 @@
 	"webgl_shaders_ocean": [ "water" ],
 	"webgl_shaders_sky": [ "sun" ],
 	"webgl_shaders_tonemapping": [ "hrd" ],
-	"webgl_shading_physical": [ "pbr" ],
 	"webgl_shadow_contact": [ "onBeforeCompile", "soft" ],
 	"webgl_shadowmap_viewer": [ "directional", "spot" ],
 	"webgl_skinning_simple": [ "animation" ],

BIN
examples/textures/patterns/bright_squares256.png


BIN
examples/textures/patterns/circuit_pattern.png


+ 0 - 6
examples/textures/patterns/readme.txt

@@ -1,6 +0,0 @@
-Texture "bright_squares256.png" from http://subtlepatterns.com/
-
-Slightly modified to have more GPU friendly sizes.
-
-Licensed under a Creative Commons Attribution 3.0 Unported License:
-http://creativecommons.org/licenses/by/3.0/

+ 0 - 629
examples/webgl_animation_cloth.html

@@ -1,629 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-	<head>
-		<title>three.js webgl - cloth simulation</title>
-		<meta charset="utf-8">
-		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
-		<link type="text/css" rel="stylesheet" href="main.css">
-		<style>
-			body {
-				background-color: #cce0ff;
-				color: #000;
-			}
-			a {
-				color: #080;
-			}
-		</style>
-	</head>
-
-	<body>
-		<div id="info">Simple Cloth Simulation<br/>
-			Verlet integration with relaxed constraints<br/>
-		</div>
-
-		<script type="module">
-
-			import * as THREE from '../build/three.module.js';
-
-			import Stats from './jsm/libs/stats.module.js';
-			import { GUI } from './jsm/libs/dat.gui.module.js';
-
-			import { OrbitControls } from './jsm/controls/OrbitControls.js';
-			import { ParametricGeometry } from './jsm/geometries/ParametricGeometry.js';
-
-			/*
-			 * Cloth Simulation using a relaxed constraints solver
-			 */
-
-			// Suggested Readings
-
-			// Advanced Character Physics by Thomas Jakobsen Character
-			// http://freespace.virgin.net/hugo.elias/models/m_cloth.htm
-			// http://en.wikipedia.org/wiki/Cloth_modeling
-			// http://cg.alexandra.dk/tag/spring-mass-system/
-			// Real-time Cloth Animation http://www.darwin3d.com/gamedev/articles/col0599.pdf
-
-			const params = {
-				enableWind: true,
-				showBall: false,
-				togglePins: togglePins
-			};
-
-			const DAMPING = 0.03;
-			const DRAG = 1 - DAMPING;
-			const MASS = 0.1;
-			const restDistance = 25;
-
-			const xSegs = 10;
-			const ySegs = 10;
-
-			const clothFunction = plane( restDistance * xSegs, restDistance * ySegs );
-
-			const GRAVITY = 981 * 1.4;
-			const gravity = new THREE.Vector3( 0, - GRAVITY, 0 ).multiplyScalar( MASS );
-
-
-			const TIMESTEP = 18 / 1000;
-			const TIMESTEP_SQ = TIMESTEP * TIMESTEP;
-
-			let pins = [];
-
-			const windForce = new THREE.Vector3( 0, 0, 0 );
-
-			const ballPosition = new THREE.Vector3( 0, - 45, 0 );
-			const ballSize = 60; //40
-
-			const tmpForce = new THREE.Vector3();
-			const diff = new THREE.Vector3();
-
-			class Particle {
-
-				constructor( x, y, z, mass ) {
-
-					this.position = new THREE.Vector3();
-					this.previous = new THREE.Vector3();
-					this.original = new THREE.Vector3();
-					this.a = new THREE.Vector3( 0, 0, 0 ); // acceleration
-					this.mass = mass;
-					this.invMass = 1 / mass;
-					this.tmp = new THREE.Vector3();
-					this.tmp2 = new THREE.Vector3();
-
-					// init
-
-					clothFunction( x, y, this.position ); // position
-					clothFunction( x, y, this.previous ); // previous
-					clothFunction( x, y, this.original );
-
-				}
-
-				// Force -> Acceleration
-
-				addForce( force ) {
-
-					this.a.add(
-						this.tmp2.copy( force ).multiplyScalar( this.invMass )
-					);
-
-				}
-
-				// Performs Verlet integration
-
-				integrate( timesq ) {
-
-					const newPos = this.tmp.subVectors( this.position, this.previous );
-					newPos.multiplyScalar( DRAG ).add( this.position );
-					newPos.add( this.a.multiplyScalar( timesq ) );
-
-					this.tmp = this.previous;
-					this.previous = this.position;
-					this.position = newPos;
-
-					this.a.set( 0, 0, 0 );
-
-				}
-
-			}
-
-			class Cloth {
-
-				constructor( w = 10, h = 10 ) {
-
-					this.w = w;
-					this.h = h;
-
-					const particles = [];
-					const constraints = [];
-
-					// Create particles
-
-					for ( let v = 0; v <= h; v ++ ) {
-
-						for ( let u = 0; u <= w; u ++ ) {
-
-							particles.push(
-								new Particle( u / w, v / h, 0, MASS )
-							);
-
-						}
-
-					}
-
-					// Structural
-
-					for ( let v = 0; v < h; v ++ ) {
-
-						for ( let u = 0; u < w; u ++ ) {
-
-							constraints.push( [
-								particles[ index( u, v ) ],
-								particles[ index( u, v + 1 ) ],
-								restDistance
-							] );
-
-							constraints.push( [
-								particles[ index( u, v ) ],
-								particles[ index( u + 1, v ) ],
-								restDistance
-							] );
-
-						}
-
-					}
-
-					for ( let u = w, v = 0; v < h; v ++ ) {
-
-						constraints.push( [
-							particles[ index( u, v ) ],
-							particles[ index( u, v + 1 ) ],
-							restDistance
-
-						] );
-
-					}
-
-					for ( let v = h, u = 0; u < w; u ++ ) {
-
-						constraints.push( [
-							particles[ index( u, v ) ],
-							particles[ index( u + 1, v ) ],
-							restDistance
-						] );
-
-					}
-
-
-					// While many systems use shear and bend springs,
-					// the relaxed constraints model seems to be just fine
-					// using structural springs.
-					// Shear
-					// const diagonalDist = Math.sqrt(restDistance * restDistance * 2);
-
-
-					// for (v=0;v<h;v++) {
-					// 	for (u=0;u<w;u++) {
-
-					// 		constraints.push([
-					// 			particles[index(u, v)],
-					// 			particles[index(u+1, v+1)],
-					// 			diagonalDist
-					// 		]);
-
-					// 		constraints.push([
-					// 			particles[index(u+1, v)],
-					// 			particles[index(u, v+1)],
-					// 			diagonalDist
-					// 		]);
-
-					// 	}
-					// }
-
-
-					this.particles = particles;
-					this.constraints = constraints;
-
-					function index( u, v ) {
-
-						return u + v * ( w + 1 );
-
-					}
-
-					this.index = index;
-
-				}
-
-			}
-
-			function plane( width, height ) {
-
-				return function ( u, v, target ) {
-
-					const x = ( u - 0.5 ) * width;
-					const y = ( v + 0.5 ) * height;
-					const z = 0;
-
-					target.set( x, y, z );
-
-				};
-
-			}
-
-			function satisfyConstraints( p1, p2, distance ) {
-
-				diff.subVectors( p2.position, p1.position );
-				const currentDist = diff.length();
-				if ( currentDist === 0 ) return; // prevents division by 0
-				const correction = diff.multiplyScalar( 1 - distance / currentDist );
-				const correctionHalf = correction.multiplyScalar( 0.5 );
-				p1.position.add( correctionHalf );
-				p2.position.sub( correctionHalf );
-
-			}
-
-			function simulate( now ) {
-
-				const windStrength = Math.cos( now / 7000 ) * 20 + 40;
-
-				windForce.set( Math.sin( now / 2000 ), Math.cos( now / 3000 ), Math.sin( now / 1000 ) );
-				windForce.normalize();
-				windForce.multiplyScalar( windStrength );
-
-				// Aerodynamics forces
-
-				const particles = cloth.particles;
-
-				if ( params.enableWind ) {
-
-					let indx;
-					const normal = new THREE.Vector3();
-					const indices = clothGeometry.index;
-					const normals = clothGeometry.attributes.normal;
-
-					for ( let i = 0, il = indices.count; i < il; i += 3 ) {
-
-						for ( let j = 0; j < 3; j ++ ) {
-
-							indx = indices.getX( i + j );
-							normal.fromBufferAttribute( normals, indx );
-							tmpForce.copy( normal ).normalize().multiplyScalar( normal.dot( windForce ) );
-							particles[ indx ].addForce( tmpForce );
-
-						}
-
-					}
-
-				}
-
-				for ( let i = 0, il = particles.length; i < il; i ++ ) {
-
-					const particle = particles[ i ];
-					particle.addForce( gravity );
-
-					particle.integrate( TIMESTEP_SQ );
-
-				}
-
-				// Start Constraints
-
-				const constraints = cloth.constraints;
-				const il = constraints.length;
-
-				for ( let i = 0; i < il; i ++ ) {
-
-					const constraint = constraints[ i ];
-					satisfyConstraints( constraint[ 0 ], constraint[ 1 ], constraint[ 2 ] );
-
-				}
-
-				// Ball Constraints
-
-				ballPosition.z = - Math.sin( now / 600 ) * 90; //+ 40;
-				ballPosition.x = Math.cos( now / 400 ) * 70;
-
-				if ( params.showBall ) {
-
-					sphere.visible = true;
-
-					for ( let i = 0, il = particles.length; i < il; i ++ ) {
-
-						const particle = particles[ i ];
-						const pos = particle.position;
-						diff.subVectors( pos, ballPosition );
-						if ( diff.length() < ballSize ) {
-
-							// collided
-							diff.normalize().multiplyScalar( ballSize );
-							pos.copy( ballPosition ).add( diff );
-
-						}
-
-					}
-
-				} else {
-
-					sphere.visible = false;
-
-				}
-
-
-				// Floor Constraints
-
-				for ( let i = 0, il = particles.length; i < il; i ++ ) {
-
-					const particle = particles[ i ];
-					const pos = particle.position;
-					if ( pos.y < - 250 ) {
-
-						pos.y = - 250;
-
-					}
-
-				}
-
-				// Pin Constraints
-
-				for ( let i = 0, il = pins.length; i < il; i ++ ) {
-
-					const xy = pins[ i ];
-					const p = particles[ xy ];
-					p.position.copy( p.original );
-					p.previous.copy( p.original );
-
-				}
-
-
-			}
-
-			/* testing cloth simulation */
-
-			const cloth = new Cloth( xSegs, ySegs );
-
-			const pinsFormation = [];
-			pins = [ 6 ];
-
-			pinsFormation.push( pins );
-
-			pins = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];
-			pinsFormation.push( pins );
-
-			pins = [ 0 ];
-			pinsFormation.push( pins );
-
-			pins = []; // cut the rope ;)
-			pinsFormation.push( pins );
-
-			pins = [ 0, cloth.w ]; // classic 2 pins
-			pinsFormation.push( pins );
-
-			pins = pinsFormation[ 1 ];
-
-			function togglePins() {
-
-				pins = pinsFormation[ ~ ~ ( Math.random() * pinsFormation.length ) ];
-
-			}
-
-			let container, stats;
-			let camera, scene, renderer;
-
-			let clothGeometry;
-			let sphere;
-			let object;
-
-			init();
-			animate( 0 );
-
-			function init() {
-
-				container = document.createElement( 'div' );
-				document.body.appendChild( container );
-
-				// scene
-
-				scene = new THREE.Scene();
-				scene.background = new THREE.Color( 0xcce0ff );
-				scene.fog = new THREE.Fog( 0xcce0ff, 500, 10000 );
-
-				// camera
-
-				camera = new THREE.PerspectiveCamera( 30, window.innerWidth / window.innerHeight, 1, 10000 );
-				camera.position.set( 1000, 50, 1500 );
-
-				// lights
-
-				scene.add( new THREE.AmbientLight( 0x666666 ) );
-
-				const light = new THREE.DirectionalLight( 0xdfebff, 1 );
-				light.position.set( 50, 200, 100 );
-				light.position.multiplyScalar( 1.3 );
-
-				light.castShadow = true;
-
-				light.shadow.mapSize.width = 1024;
-				light.shadow.mapSize.height = 1024;
-
-				const d = 300;
-
-				light.shadow.camera.left = - d;
-				light.shadow.camera.right = d;
-				light.shadow.camera.top = d;
-				light.shadow.camera.bottom = - d;
-
-				light.shadow.camera.far = 1000;
-
-				scene.add( light );
-
-				// cloth material
-
-				const loader = new THREE.TextureLoader();
-				const clothTexture = loader.load( 'textures/patterns/circuit_pattern.png' );
-				clothTexture.anisotropy = 16;
-
-				const clothMaterial = new THREE.MeshLambertMaterial( {
-					alphaMap: clothTexture,
-					side: THREE.DoubleSide,
-					alphaTest: 0.5
-				} );
-
-				// cloth geometry
-
-				clothGeometry = new ParametricGeometry( clothFunction, cloth.w, cloth.h );
-
-				// cloth mesh
-
-				object = new THREE.Mesh( clothGeometry, clothMaterial );
-				object.position.set( 0, 0, 0 );
-				object.castShadow = true;
-				scene.add( object );
-
-				// sphere
-
-				const ballGeo = new THREE.SphereGeometry( ballSize, 32, 16 );
-				const ballMaterial = new THREE.MeshLambertMaterial();
-
-				sphere = new THREE.Mesh( ballGeo, ballMaterial );
-				sphere.castShadow = true;
-				sphere.receiveShadow = true;
-				sphere.visible = false;
-				scene.add( sphere );
-
-				// ground
-
-				const groundTexture = loader.load( 'textures/terrain/grasslight-big.jpg' );
-				groundTexture.wrapS = groundTexture.wrapT = THREE.RepeatWrapping;
-				groundTexture.repeat.set( 25, 25 );
-				groundTexture.anisotropy = 16;
-				groundTexture.encoding = THREE.sRGBEncoding;
-
-				const groundMaterial = new THREE.MeshLambertMaterial( { map: groundTexture } );
-
-				let mesh = new THREE.Mesh( new THREE.PlaneGeometry( 20000, 20000 ), groundMaterial );
-				mesh.position.y = - 250;
-				mesh.rotation.x = - Math.PI / 2;
-				mesh.receiveShadow = true;
-				scene.add( mesh );
-
-				// poles
-
-				const poleGeo = new THREE.BoxGeometry( 5, 375, 5 );
-				const poleMat = new THREE.MeshLambertMaterial();
-
-				mesh = new THREE.Mesh( poleGeo, poleMat );
-				mesh.position.x = - 125;
-				mesh.position.y = - 62;
-				mesh.receiveShadow = true;
-				mesh.castShadow = true;
-				scene.add( mesh );
-
-				mesh = new THREE.Mesh( poleGeo, poleMat );
-				mesh.position.x = 125;
-				mesh.position.y = - 62;
-				mesh.receiveShadow = true;
-				mesh.castShadow = true;
-				scene.add( mesh );
-
-				mesh = new THREE.Mesh( new THREE.BoxGeometry( 255, 5, 5 ), poleMat );
-				mesh.position.y = - 250 + ( 750 / 2 );
-				mesh.position.x = 0;
-				mesh.receiveShadow = true;
-				mesh.castShadow = true;
-				scene.add( mesh );
-
-				const gg = new THREE.BoxGeometry( 10, 10, 10 );
-				mesh = new THREE.Mesh( gg, poleMat );
-				mesh.position.y = - 250;
-				mesh.position.x = 125;
-				mesh.receiveShadow = true;
-				mesh.castShadow = true;
-				scene.add( mesh );
-
-				mesh = new THREE.Mesh( gg, poleMat );
-				mesh.position.y = - 250;
-				mesh.position.x = - 125;
-				mesh.receiveShadow = true;
-				mesh.castShadow = true;
-				scene.add( mesh );
-
-				// renderer
-
-				renderer = new THREE.WebGLRenderer( { antialias: true } );
-				renderer.setPixelRatio( window.devicePixelRatio );
-				renderer.setSize( window.innerWidth, window.innerHeight );
-
-				container.appendChild( renderer.domElement );
-
-				renderer.outputEncoding = THREE.sRGBEncoding;
-
-				renderer.shadowMap.enabled = true;
-
-				// controls
-				const controls = new OrbitControls( camera, renderer.domElement );
-				controls.maxPolarAngle = Math.PI * 0.5;
-				controls.minDistance = 1000;
-				controls.maxDistance = 5000;
-
-				// performance monitor
-
-				stats = new Stats();
-				container.appendChild( stats.dom );
-
-				//
-
-				window.addEventListener( 'resize', onWindowResize );
-
-				//
-
-				const gui = new GUI();
-				gui.add( params, 'enableWind' ).name( 'Enable wind' );
-				gui.add( params, 'showBall' ).name( 'Show ball' );
-				gui.add( params, 'togglePins' ).name( 'Toggle pins' );
-
-			}
-
-			//
-
-			function onWindowResize() {
-
-				camera.aspect = window.innerWidth / window.innerHeight;
-				camera.updateProjectionMatrix();
-
-				renderer.setSize( window.innerWidth, window.innerHeight );
-
-			}
-
-			//
-
-			function animate( now ) {
-
-				requestAnimationFrame( animate );
-				simulate( now );
-				render();
-				stats.update();
-
-			}
-
-			function render() {
-
-				const p = cloth.particles;
-
-				for ( let i = 0, il = p.length; i < il; i ++ ) {
-
-					const v = p[ i ].position;
-
-					clothGeometry.attributes.position.setXYZ( i, v.x, v.y, v.z );
-
-				}
-
-				clothGeometry.attributes.position.needsUpdate = true;
-
-				clothGeometry.computeVertexNormals();
-
-				sphere.position.copy( ballPosition );
-
-				renderer.render( scene, camera );
-
-			}
-
-		</script>
-	</body>
-</html>

+ 0 - 363
examples/webgl_shading_physical.html

@@ -1,363 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-	<head>
-		<title>three.js webgl - physically based shading</title>
-		<meta charset="utf-8">
-		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
-		<link type="text/css" rel="stylesheet" href="main.css">
-	</head>
-
-	<body>
-		<div id="info">
-			<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> - webgl physically based shading testbed
-		</div>
-
-		<script type="module">
-
-			import * as THREE from '../build/three.module.js';
-
-			import Stats from './jsm/libs/stats.module.js';
-
-			import { GUI } from './jsm/libs/dat.gui.module.js';
-			import { TrackballControls } from './jsm/controls/TrackballControls.js';
-			import { GLTFLoader } from './jsm/loaders/GLTFLoader.js';
-
-			let stats;
-
-			let camera, scene, renderer;
-
-			let mesh;
-
-			let controls;
-
-			let cubeCamera;
-
-			let sunLight, pointLight, ambientLight;
-
-			let mixer;
-
-			const clock = new THREE.Clock();
-
-			let gui, shadowCameraHelper;
-
-			const shadowConfig = {
-
-				shadowCameraVisible: false,
-				shadowCameraNear: 750,
-				shadowCameraFar: 4000,
-				shadowBias: - 0.0002
-
-			};
-
-			init();
-			animate();
-
-			function init() {
-
-				const container = document.createElement( 'div' );
-				document.body.appendChild( container );
-
-				// CAMERA
-
-				camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 2, 10000 );
-				camera.position.set( 500, 400, 1200 );
-
-				// SCENE
-
-				scene = new THREE.Scene();
-				scene.fog = new THREE.Fog( 0, 1000, 10000 );
-
-				// CUBE CAMERA
-
-				const cubeRenderTarget = new THREE.WebGLCubeRenderTarget( 128, {
-					format: THREE.RGBFormat,
-					generateMipmaps: true,
-					minFilter: THREE.LinearMipmapLinearFilter,
-					encoding: THREE.sRGBEncoding
-				} );
-				cubeCamera = new THREE.CubeCamera( 1, 10000, cubeRenderTarget );
-
-				// TEXTURES
-				const textureLoader = new THREE.TextureLoader();
-
-				const textureSquares = textureLoader.load( "textures/patterns/bright_squares256.png" );
-				textureSquares.repeat.set( 50, 50 );
-				textureSquares.wrapS = textureSquares.wrapT = THREE.RepeatWrapping;
-				textureSquares.magFilter = THREE.NearestFilter;
-				textureSquares.encoding = THREE.sRGBEncoding;
-
-				const textureNoiseColor = textureLoader.load( "textures/disturb.jpg" );
-				textureNoiseColor.repeat.set( 1, 1 );
-				textureNoiseColor.wrapS = textureNoiseColor.wrapT = THREE.RepeatWrapping;
-				textureNoiseColor.encoding = THREE.sRGBEncoding;
-
-				const textureLava = textureLoader.load( "textures/lava/lavatile.jpg" );
-				textureLava.repeat.set( 6, 2 );
-				textureLava.wrapS = textureLava.wrapT = THREE.RepeatWrapping;
-				textureLava.encoding = THREE.sRGBEncoding;
-
-				// GROUND
-
-				const groundMaterial = new THREE.MeshPhongMaterial( {
-					shininess: 80,
-					color: 0xffffff,
-					specular: 0xffffff,
-					map: textureSquares
-				} );
-
-				const planeGeometry = new THREE.PlaneGeometry( 100, 100 );
-
-				const ground = new THREE.Mesh( planeGeometry, groundMaterial );
-				ground.position.set( 0, 0, 0 );
-				ground.rotation.x = - Math.PI / 2;
-				ground.scale.set( 1000, 1000, 1000 );
-				ground.receiveShadow = true;
-				scene.add( ground );
-
-				// MATERIALS
-
-				const materialLambert = new THREE.MeshPhongMaterial( { shininess: 50, color: 0xffffff, map: textureNoiseColor } );
-				const materialPhong = new THREE.MeshPhongMaterial( { shininess: 50, color: 0xffffff, specular: 0x999999, map: textureLava } );
-				const materialPhongCube = new THREE.MeshPhongMaterial( { shininess: 50, color: 0xffffff, specular: 0x999999, envMap: cubeRenderTarget.texture } );
-
-				// OBJECTS
-
-				const sphereGeometry = new THREE.SphereGeometry( 100, 64, 32 );
-				const torusGeometry = new THREE.TorusGeometry( 240, 60, 32, 64 );
-				const cubeGeometry = new THREE.BoxGeometry( 150, 150, 150 );
-
-				addObject( torusGeometry, materialPhong, 0, 100, 0, 0 );
-				addObject( cubeGeometry, materialLambert, 350, 75, 300, 0 );
-
-				mesh = addObject( sphereGeometry, materialPhongCube, 350, 100, - 350, 0 );
-				mesh.add( cubeCamera );
-
-				function addObjectColor( geometry, color, x, y, z, ry ) {
-
-					const material = new THREE.MeshPhongMaterial( { color: 0xffffff } );
-
-					return addObject( geometry, material, x, y, z, ry );
-
-				}
-
-				function addObject( geometry, material, x, y, z, ry ) {
-
-					const tmpMesh = new THREE.Mesh( geometry, material );
-
-					tmpMesh.material.color.offsetHSL( 0.1, - 0.1, 0 );
-
-					tmpMesh.position.set( x, y, z );
-
-					tmpMesh.rotation.y = ry;
-
-					tmpMesh.castShadow = true;
-					tmpMesh.receiveShadow = true;
-
-					scene.add( tmpMesh );
-
-					return tmpMesh;
-
-				}
-
-				const bigCube = new THREE.BoxGeometry( 50, 500, 50 );
-				const midCube = new THREE.BoxGeometry( 50, 200, 50 );
-				const smallCube = new THREE.BoxGeometry( 100, 100, 100 );
-
-				addObjectColor( bigCube, 0xff0000, - 500, 250, 0, 0 );
-				addObjectColor( smallCube, 0xff0000, - 500, 50, - 150, 0 );
-
-				addObjectColor( midCube, 0x00ff00, 500, 100, 0, 0 );
-				addObjectColor( smallCube, 0x00ff00, 500, 50, - 150, 0 );
-
-				addObjectColor( midCube, 0x0000ff, 0, 100, - 500, 0 );
-				addObjectColor( smallCube, 0x0000ff, - 150, 50, - 500, 0 );
-
-				addObjectColor( midCube, 0xff00ff, 0, 100, 500, 0 );
-				addObjectColor( smallCube, 0xff00ff, - 150, 50, 500, 0 );
-
-				addObjectColor( new THREE.BoxGeometry( 500, 10, 10 ), 0xffff00, 0, 600, 0, Math.PI / 4 );
-				addObjectColor( new THREE.BoxGeometry( 250, 10, 10 ), 0xffff00, 0, 600, 0, 0 );
-
-				addObjectColor( new THREE.SphereGeometry( 100, 32, 26 ), 0xffffff, - 300, 100, 300, 0 );
-
-				// MORPHS
-
-				const loader = new GLTFLoader();
-
-				loader.load( "models/gltf/SittingBox.glb", function ( gltf ) {
-
-					const mesh = gltf.scene.children[ 0 ];
-
-					mixer = new THREE.AnimationMixer( mesh );
-
-					mixer.clipAction( gltf.animations[ 0 ] ).setDuration( 10 ).play();
-
-					const s = 200;
-					mesh.scale.set( s, s, s );
-
-					mesh.castShadow = true;
-					mesh.receiveShadow = true;
-
-					scene.add( mesh );
-
-				} );
-
-				// LIGHTS
-
-				ambientLight = new THREE.AmbientLight( 0x3f2806 );
-				scene.add( ambientLight );
-
-				pointLight = new THREE.PointLight( 0xffaa00, 1, 5000 );
-				scene.add( pointLight );
-
-				sunLight = new THREE.DirectionalLight( 0xffffff, 0.3 );
-				sunLight.position.set( 1000, 2000, 1000 );
-				sunLight.castShadow = true;
-				sunLight.shadow.camera.top = 750;
-				sunLight.shadow.camera.bottom = - 750;
-				sunLight.shadow.camera.left = - 750;
-				sunLight.shadow.camera.right = 750;
-				sunLight.shadow.camera.near = shadowConfig.shadowCameraNear;
-				sunLight.shadow.camera.far = shadowConfig.shadowCameraFar;
-				sunLight.shadow.mapSize.set( 1024, 1024 );
-				sunLight.shadow.bias = shadowConfig.shadowBias;
-
-				scene.add( sunLight );
-
-				// SHADOW CAMERA HELPER
-
-				shadowCameraHelper = new THREE.CameraHelper( sunLight.shadow.camera );
-				shadowCameraHelper.visible = shadowConfig.shadowCameraVisible;
-				scene.add( shadowCameraHelper );
-
-				// RENDERER
-
-				renderer = new THREE.WebGLRenderer( { antialias: true } );
-				renderer.setPixelRatio( window.devicePixelRatio );
-				renderer.setSize( window.innerWidth, window.innerHeight );
-				container.appendChild( renderer.domElement );
-
-				//
-
-				renderer.shadowMap.enabled = true;
-				renderer.shadowMap.type = THREE.PCFSoftShadowMap;
-				renderer.outputEncoding = THREE.sRGBEncoding;
-
-				//
-
-				controls = new TrackballControls( camera, renderer.domElement );
-				controls.target.set( 0, 120, 0 );
-
-				controls.rotateSpeed = 1.0;
-				controls.zoomSpeed = 1.2;
-				controls.panSpeed = 0.8;
-
-				controls.staticMoving = true;
-
-				controls.keys = [ 'KeyA', 'KeyS', 'KeyD' ];
-
-
-				// STATS
-
-				stats = new Stats();
-				container.appendChild( stats.dom );
-
-				// EVENTS
-
-				window.addEventListener( 'resize', onWindowResize );
-
-				// GUI
-
-				gui = new GUI( { width: 400 } );
-
-				// SHADOW
-
-				const shadowGUI = gui.addFolder( "Shadow" );
-
-    		shadowGUI.add( shadowConfig, 'shadowCameraVisible' ).onChange( function () {
-
-					shadowCameraHelper.visible = shadowConfig.shadowCameraVisible;
-
-				} );
-
-				shadowGUI.add( shadowConfig, 'shadowCameraNear', 1, 1500 ).onChange( function () {
-
-					sunLight.shadow.camera.near = shadowConfig.shadowCameraNear;
-					sunLight.shadow.camera.updateProjectionMatrix();
-					shadowCameraHelper.update();
-
-				} );
-
-				shadowGUI.add( shadowConfig, 'shadowCameraFar', 1501, 5000 ).onChange( function () {
-
-					sunLight.shadow.camera.far = shadowConfig.shadowCameraFar;
-					sunLight.shadow.camera.updateProjectionMatrix();
-					shadowCameraHelper.update();
-
-				} );
-
-				shadowGUI.add( shadowConfig, 'shadowBias', - 0.01, 0.01 ).onChange( function () {
-
-					sunLight.shadow.bias = shadowConfig.shadowBias;
-
-				} );
-
-				shadowGUI.open();
-
-			}
-
-			//
-
-			function onWindowResize() {
-
-				camera.aspect = window.innerWidth / window.innerHeight;
-				camera.updateProjectionMatrix();
-
-				renderer.setSize( window.innerWidth, window.innerHeight );
-
-				controls.handleResize();
-
-			}
-
-			//
-
-			function animate() {
-
-				requestAnimationFrame( animate );
-
-				stats.begin();
-				render();
-				stats.end();
-
-			}
-
-			function render() {
-
-				// update
-
-				const delta = clock.getDelta();
-
-				controls.update();
-
-				if ( mixer ) {
-
-					mixer.update( delta );
-
-				}
-
-				// render cube map
-
-				mesh.visible = false;
-				cubeCamera.update( renderer, scene );
-				mesh.visible = true;
-
-				// render scene
-
-				renderer.render( scene, camera );
-
-			}
-
-		</script>
-
-	</body>
-</html>