Getting Started

Start a new project in 3DE. Choose the 3D starter project (with Animation) template from the menu. Then save it with the name Lights and Materials.

We will again work with the best shape in the world, the donut. So add the following code below START CODING ON THE NEXT LINE.

​ ​var​ shape = ​new​ THREE.TorusGeometry(50, 20, 8, 20);
​ ​var​ cover = ​new​ THREE.MeshPhongMaterial({color: ​'red'​});
​ ​var​ donut = ​new​ THREE.Mesh(shape, cover);
​ donut.position.​set​(0, 150, 0);
​ scene.add(donut);

If you’ve done everything correctly, then you should see a very dull red donut. You might be thinking, “That’s it?” Well, of course that’s not it!

The most important thing to note here ...

Get 3D Game Programming for Kids, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.