提交 5ca359bc 编写于 作者: W WestLangley

Improved lighting; clean up

上级 e4de65e9
......@@ -56,7 +56,7 @@
container = document.getElementById( 'container' );
camera = new THREE.PerspectiveCamera( 25, window.innerWidth / window.innerHeight, 1, 10000 );
camera = new THREE.PerspectiveCamera( 25, window.innerWidth / window.innerHeight, 1, 1000 );
camera.position.set( 15, 10, - 15 );
scene = new THREE.Scene();
......@@ -71,6 +71,16 @@
var animations = collada.animations;
var avatar = collada.scene;
avatar.traverse( function( node ) {
if ( node.isSkinnedMesh ) {
node.frustumCulled = false;
}
} );
mixer = new THREE.AnimationMixer( avatar );
var action = mixer.clipAction( animations[ 0 ] ).play();
......@@ -88,9 +98,9 @@
var ambientLight = new THREE.AmbientLight( 0xffffff, 0.2 );
scene.add( ambientLight );
var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.8 );
directionalLight.position.set( 1, 1, - 1 );
scene.add( directionalLight );
var pointLight = new THREE.PointLight( 0xffffff, 0.8 );
scene.add( camera );
camera.add( pointLight );
//
......@@ -102,6 +112,9 @@
//
controls = new THREE.OrbitControls( camera, renderer.domElement );
controls.screenSpacePanning = true;
controls.minDistance = 5;
controls.maxDistance = 40;
controls.target.set( 0, 2, 0 );
controls.update();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册