josdirksen / learning-threejs

Code repository for the examples from the Packt book "Learning Threejs"
3.1k stars 1.27k forks source link

renderer.setClearColorHex() is not a function #13

Open bengben opened 9 years ago

bengben commented 9 years ago

In:【 learning-threejs/chapter-01/02-first-scene.html 】

the method setClearColorHex() has changed to setClearColor() ?

feeltheburn commented 9 years ago

Correct... the book gets odd in that area, as later snippets in the book show

(page 16) renderer.setClearColorHex() renderer.setClearColor(new THREE.Color(0xEEEEEE));

which is also hosed.

The correct line is:

renderer.setClearColor(new THREE.Color(0xEEEEEE, 1.0));

dehuszar commented 8 years ago

renderer.setClearColor(0xEEEEEE, 1) also works. I didn't need to use THREE.Color at all.