Saturday, October 18, 2008

open-source as3.0 Voxel terrain engine v0.1 released

New Version:


Interested in generating terrains, I wanted to create a real-time terrain engine on flash. I'm trying to write one using action script 3.0 using some 3D classes and perlin noise but it's not finished yet.
Not long before I found Andrea "6502" Griffini's old demo of his voxel terrain (NEWVOX.C). The original C code is really clear and the final work is impressive. So I decided to write another voxel terrain engine using his code.
This is the first step, I just 'translate' his C code into action script 3.0. What I want to do is add textures of terrain, sky and the background, and maybe some lighting effect as well. It's far from being finished.

HERE (use arrow keys to move)
Source Code:
C(by Andrea "6502" Griffini): thanks to FengYun
AS3.0: HERE Latest

Links: (JS&Java demo with texture) (html5) 

Update on 2012-12-11:
lizhi posted the modified code on wonderfl: (AS3)

Update on 2019-Feb-11:
Voxel terrain rendering algorithm in less than 20 lines of code:  (Python, JavaScript)


  1. Hello.
    I'm actualy working on your AS3 translation of Griffini's work, and I just can't figure out how to make the "sky" transparent without affecting all the black colors (shadows) to transparent.

    Can you help me on this one?

    Sorry for crap english.

  2. And by the way, bravo, pretty good work.

  3. @Anonymous: Here it is:
    Simple solution for transparent sky. Hope that can help.

  4. Thanks a lot Bruce.
    that's exactly what I was looking for.

    Thanks again.

    You roxx