eqiproo
eqiproo

Reputation: 1816

The scene isn't rendered (three.js)

I've created a simple scene in three.js, but it doesn't works with canvas renderer (but it should work...)

Code: http://jsfiddle.net/PRkcJ/

It only works, if I use webGLrenderer. But why?

Thanks in advance,

Upvotes: 3

Views: 290

Answers (1)

WestLangley
WestLangley

Reputation: 104833

What you are getting is a white plane on a white background.

The light position for directional lights is treated as a direction vector and it must be of unit length.

Your code works if you do something like this:

light.position.set(-100, 150, 0).normalize();

Fiddle: http://jsfiddle.net/PRkcJ/1/

Upvotes: 3

Related Questions