nbriz / threejs_playGnd

pedagogical + experimental tool/space/editor for three.js/webGL
55 stars 16 forks source link

Enabling lights, plane, and environment #10

Open mauropesce opened 10 years ago

mauropesce commented 10 years ago

How to do this? Do I need to tweak the given code to make it work on the final animation? I spent some time looking other archives but didn't see anything helpful.

Thanks.

yyolk commented 10 years ago

Do you have an example sketch that you could reference?

Usually you have to add lights, models, and environment to your scene and then render the scene.

mauropesce commented 10 years ago

Yep, this one http://threejsplaygnd.brangerbriz.net/s/?id=815

mauropesce commented 10 years ago

And this is how it looks on the GUI

screen shot 2014-03-25 at 10 52 59 pm screen shot 2014-03-25 at 10 52 40 pm

nbriz commented 10 years ago

it's all there, you just have to change the position of ur camera ( by default the editor looks at ur object head on ) >> here's an example: http://threejsplaygnd.brangerbriz.net/s/?id=818

i just added this to the draw function:

    camera.lookAt(mesh.position);
    camera.position.x = Math.sin( Date.now() * 0.002 ) * 50;
    camera.position.y = Math.sin( Date.now() * 0.002 ) * 50 + 100;

...thats all code found in the snippets menu :)

mauropesce commented 10 years ago

Great, thanks! Just now I started playing with camera and animation http://threejsplaygnd.brangerbriz.net/s/?id=819