O'Reilly logo

WebGL Game Development by Sumeet Arora

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Rendering 3D objects

To put our earlier knowledge to use, first we need to learn how to render 3D objects. We will first create a 3D object, a cube or any geometry, in Blender, a free and open source 3D creation software (http://www.blender.org/).

We will then export this 3D model as a Wavefront object file. The Wavefront .obj format will then be parsed via a Python script and will be converted and saved as a JSON file. We use the JSON format as it can be easily parsed by JavaScript. We can parse an OBJ file in JavaScript as well but it would be time-consuming and slow.

Exporting a 3D object from Blender

The following are the steps we need to perform to export an object from Blender:

  1. Open Blender and go to Add | Mesh | Cube, as shown in the following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required