Skip to content

Commit f4f54bf

Browse files
committed
Merge pull request Ovilia#4 from Ovilia/gh-pages
Update master
2 parents 4882c2c + b89cfa0 commit f4f54bf

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Chapter8/8.4.1.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
var alpha = 0;
1313

1414
function init() {
15-
renderer = new THREE.WebGLRenderer({
16-
canvas: document.getElementById('mainCanvas')
17-
});
18-
renderer.setClearColor(0x000000);
15+
renderer = new THREE.WebGLRenderer();
16+
renderer.setSize(400, 300);
17+
18+
var container = document.getElementById('canvas');
19+
container.appendChild(renderer.domElement);
1920
renderer.shadowMapEnabled = true;
2021

2122
scene = new THREE.Scene();
@@ -67,6 +68,6 @@
6768
</head>
6869

6970
<body onload="init()">
70-
<canvas id="mainCanvas" width="400px" height="300px" ></canvas>
71+
<div id="canvas" width="400px" height="300px"></div>
7172
</body>
7273
</html>

0 commit comments

Comments
 (0)