|
@@ -43,15 +43,15 @@
|
|
|
const container = document.createElement( 'div' );
|
|
|
document.body.appendChild( container );
|
|
|
|
|
|
- camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 0.1, 1000 );
|
|
|
- camera.position.set( 0, 50, 250 );
|
|
|
+ camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 0.1, 100 );
|
|
|
+ camera.position.set( 0, 1, 5 );
|
|
|
|
|
|
scene = new THREE.Scene();
|
|
|
|
|
|
//
|
|
|
|
|
|
const loader = new TGALoader();
|
|
|
- const geometry = new THREE.BoxGeometry( 50, 50, 50 );
|
|
|
+ const geometry = new THREE.BoxGeometry();
|
|
|
|
|
|
// add box 1 - grey8 texture
|
|
|
|
|
@@ -60,7 +60,7 @@
|
|
|
const material1 = new THREE.MeshPhongMaterial( { color: 0xffffff, map: texture1 } );
|
|
|
|
|
|
const mesh1 = new THREE.Mesh( geometry, material1 );
|
|
|
- mesh1.position.x = - 50;
|
|
|
+ mesh1.position.x = - 1;
|
|
|
|
|
|
scene.add( mesh1 );
|
|
|
|
|
@@ -71,16 +71,16 @@
|
|
|
const material2 = new THREE.MeshPhongMaterial( { color: 0xffffff, map: texture2 } );
|
|
|
|
|
|
const mesh2 = new THREE.Mesh( geometry, material2 );
|
|
|
- mesh2.position.x = 50;
|
|
|
+ mesh2.position.x = 1;
|
|
|
|
|
|
scene.add( mesh2 );
|
|
|
|
|
|
//
|
|
|
|
|
|
- const ambientLight = new THREE.AmbientLight( 0xffffff, 0.4 );
|
|
|
+ const ambientLight = new THREE.AmbientLight( 0xffffff, 1.5 );
|
|
|
scene.add( ambientLight );
|
|
|
|
|
|
- const light = new THREE.DirectionalLight( 0xffffff, 1 );
|
|
|
+ const light = new THREE.DirectionalLight( 0xffffff, 2.5 );
|
|
|
light.position.set( 1, 1, 1 );
|
|
|
scene.add( light );
|
|
|
|
|
@@ -89,6 +89,7 @@
|
|
|
renderer = new THREE.WebGLRenderer( { antialias: true } );
|
|
|
renderer.setPixelRatio( window.devicePixelRatio );
|
|
|
renderer.setSize( window.innerWidth, window.innerHeight );
|
|
|
+ renderer.useLegacyLights = false;
|
|
|
container.appendChild( renderer.domElement );
|
|
|
|
|
|
//
|