Mark Feldman's Home Page
Login   Search
Skip Navigation Links
  • Home
  • A RepRap is Born
  • Mini Prusa Build
  • Wireless Controllers
  • Terrain Demo
  • KopiLua (Lua for C#)
  • Arduino
  • About Me
Skip Navigation Links>Terrain Demo
This is just a simple little demo I whipped up in Javascript to show software-rendered 3D heightfields. You'll need a reasonably powered machine to run it properly, it'll run on an iPhone but it will be a slide-show. Unfortunately it won't run on Internet Explorer, at least not until they add support for Canvas.

Feel free to have a peek at the source code. It basically just casts out one ray per screen column and samples the terrain at discrete z-distances using bilinear interpolation. Linear interpolation is used to shade the terrain along the y axis, the reflection is an inverted render of the main terrain.