Permalink
Browse files

GUI: Added default light.

  • Loading branch information...
1 parent e5d97a0 commit c4ad8be241cf3842883a035fe1fe92058c1fb2f4 @mrdoob committed May 26, 2012
Showing with 12 additions and 3 deletions.
  1. +3 −3 gui/index.html
  2. +9 −0 gui/js/ui/Viewport.js
View
@@ -102,7 +102,7 @@
var loader = new THREE.GeometryLoader();
var geometry = loader.parse( JSON.parse( contents ) );
- var material = new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe: true } );
+ var material = new THREE.MeshLambertMaterial( { color: 0xffffff } );
var mesh = new THREE.Mesh( geometry, material );
signals.objectAdded.dispatch( mesh );
@@ -132,7 +132,7 @@
var loader = new THREE.VTKLoader();
var geometry = loader.parse( contents );
- var material = new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe: true } );
+ var material = new THREE.MeshLambertMaterial( { color: 0xffffff } );
var mesh = new THREE.Mesh( geometry, material );
signals.objectAdded.dispatch( mesh );
@@ -152,7 +152,7 @@
//
var geometry = new THREE.SphereGeometry( 75, 25, 15 );
- var material = new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff } );
+ var material = new THREE.MeshLambertMaterial( { color: Math.random() * 0xffffff } );
var mesh = new THREE.Mesh( geometry, material );
signals.objectAdded.dispatch( mesh );
@@ -56,6 +56,15 @@ var Viewport = function ( signals ) {
controls.dynamicDampingFactor = 0.3;
controls.addEventListener( 'change', render );
+ var light = new THREE.DirectionalLight( 0xffffff );
+ light.position.set( 1, 0.5, 0 ).normalize();
+ scene.add( light );
+
+ var light = new THREE.DirectionalLight( 0xffffff, 0.5 );
+ light.position.set( - 1, - 0.5, 0 ).normalize();
+ scene.add( light );
+
+
// object picking
var projector = new THREE.Projector();

0 comments on commit c4ad8be

Please sign in to comment.