Skip to content

Commit 6d85bcd

Browse files
committed
Improved webgl_effects_ascii example.
1 parent 2f1ba8f commit 6d85bcd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

examples/webgl_effects_ascii.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#info {
1616
position: absolute;
1717
top: 0px; width: 100%;
18-
color: #000000;
18+
color: #ffffff;
1919
padding: 5px;
2020
font-family:Monospace;
2121
font-size:13px;
@@ -66,7 +66,6 @@
6666
controls = new THREE.TrackballControls( camera );
6767

6868
scene = new THREE.Scene();
69-
scene.background = new THREE.Color( 0xf0f0f0 );
7069

7170
var light = new THREE.PointLight( 0xffffff );
7271
light.position.set( 500, 500, 500 );
@@ -76,7 +75,7 @@
7675
light.position.set( - 500, - 500, - 500 );
7776
scene.add( light );
7877

79-
sphere = new THREE.Mesh( new THREE.SphereBufferGeometry( 200, 20, 10 ), new THREE.MeshLambertMaterial() );
78+
sphere = new THREE.Mesh( new THREE.SphereBufferGeometry( 200, 20, 10 ), new THREE.MeshPhongMaterial( { flatShading: true }) );
8079
scene.add( sphere );
8180

8281
// Plane
@@ -86,11 +85,13 @@
8685
plane.rotation.x = - Math.PI / 2;
8786
scene.add( plane );
8887

89-
renderer = new THREE.WebGLRenderer( { antialias: true } );
88+
renderer = new THREE.WebGLRenderer();
9089
renderer.setSize( window.innerWidth, window.innerHeight );
9190

92-
effect = new THREE.AsciiEffect( renderer );
91+
effect = new THREE.AsciiEffect( renderer, ' .:-+*=%@#', { invert: true } );
9392
effect.setSize( window.innerWidth, window.innerHeight );
93+
effect.domElement.style.color = 'white';
94+
effect.domElement.style.backgroundColor = 'black';
9495

9596
// Special case: append effect.domElement, instead of renderer.domElement.
9697
// AsciiEffect creates a custom domElement (a div container) where the ASCII elements are placed.

0 commit comments

Comments
 (0)