Warping Shapes to Make Unique Things

So far in this book we’ve managed to build interesting games by combining basic shapes. Often that’s enough to make unique and challenging games. But sometimes we need to push 3D programming just a bit further to build truly interesting shapes and landscapes. We’ll do that for the river in this game.

We’ll build our river out of just two pieces: land and water. Our land will be a flat plane. Our water will also be a flat plane that lies just a little bit beneath land. To make the river, we’ll pull pieces of land below the water. This is a very powerful technique in 3D animation made even more powerful thanks to the laws of physics. Let’s get started.

Add the addRiver function to the bottom of our code outline ...

Get 3D Game Programming for Kids now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.