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

Extending our terrain with physics

In our existing code packets, we have a terrain which is a simple plain, with no bumps or plateaus or dips. Hence, we use an object of the jigLib.Plain class to represent it in our physics world. This section intends to end what we started with a true physics terrain. The following screenshot shows you the terrain that we will be targeting to initialize in the physics world. It has a bump that starts from the center of the terrain:

Extending our terrain with physics

We can easily add this bump to the geometry, but it will take some effort to simulate it in our physics world. So, first we add this bump to our geometry. Open PlaneGeometry.js from the ...

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