Wednesday, December 24, 2008

Z-Ground Merry Christmas !

A new demo of Z-Ground, pure code swf.
FEATURE:snow, tree and shadow.

Wednesday, December 10, 2008

z-ground goes 'real' 3D ! - z-ground FP10 preview

This demo shows the future of z-ground engine. It combines flash 10's 3D API with the core of z-ground. Technically, z-ground engine is still independent of flash 10's 3D functions. What you see here can also be achieved by using some old pseudo 3D tricks in flash 9, such as what is done in Papervision 3D. But no doubt flash 10 is simple and much better! After the release of z-ground v0.1 FP9 (maybe in the first or second month in 2009), this is what I will be busy with. (flash player 10 required)


arrow keys-move


wheel-change FOV

Thursday, November 20, 2008

Maximum z-ground ---- z-ground FP9 v 0.1 preview

I am preparing new demos of z-ground engine recently. What I want to do half an year ago were almost finished. Source code of the engine is still under optimization. I think the code v0.1 for flash player 9 will be available in the following year - 2009.
Optimization is a really taught task. I'm disappointed at the efficiency of my z-ground engine but don't know how to make it faster. The demo below shows some new features of the engine. I'm sure no PC can run it at the speed of 20 FPS or above currently. That's why there are only pictures instead of the swf. I am also considering upgrade it on flash player 10.

new features of z-ground

1.walls & ceilings

This enable us to create rooms on the ground.
The way of drawing walls is totally different from the pre-released demo and much more efficient.
2.z-sky vs b-sky

You can choose between z-sky and background sky. I prefer z-sky because it's more real.

Our ground now can have height. It's real terrain because you can get the height value of any point on the ground. That means you can apply a height map to create terrains.
4.time of the day

We can change the time of our world, the position of sun, brightness of stage, color of the clouds and shadows of objects will change according to the time.
5.real time soft shadows
Objects can display shadows on the ground, that are real time shadows which will change to the position of the sun.
6.sun ray effect
The sun now have soft rays.
7.water and reflection
We can create lakes on the ground.
8.textures without any picture & image
All the textures of this new demo are created and rendered by my texture generator engine. Actually, the first demo showed above is a pure code swf. You can create textures by code and render them on the fly. But if you want to create some more colorful world, you can choose your pictures as textures.
9.bump mapping

I don't think this will be very useful. But you can create bump ground or walls if you like.
10.3D slice objects

Saturday, October 25, 2008

Z-Ground Terrain demo

This demo was just to test my way of rendering terrain in z-ground engine. It is half-finished, not smooth, doesn't 'looks right', and the code is a mess. All in all the result is not very satisfactory but at least it prove that my way works!After some optimization it will be usable, I think.

It looks like some kind of voxel rendering effect but actually not.(I also write one 3D Voxel Terrain engine using as3.0, if you are interested, here it is(with code))
I use nothing but some basic ideas of z-ground to create it. Again, this swf was created by pure code, the textures were generated by my texture generator engine on the fly.
By the way, my next demo of z-ground, which is almost done, is about lighting and shadow, water reflection effect of z-ground engine.

Demo:HERE(arrow key to move)
(BE CAREFUL! It needs lots of time for pre-rendering,to avoid crashing you computer,download it and use a flash player to view. )

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)

Sunday, September 28, 2008

New demo of Z-Ground out!

This demo of my Z-Ground was half-finished about a month ago. I want to make it better so didn't let it out that time. But now I'm aware that I will be very busy for something else in the following months. Not much time for flash, so I decide to share it first. However, code is not available this time. Just be patient, all the documented sources will go public sooner or later. OK, now let's see what I am doing :

The biggest difference this demo from the old one is this swf is created by pure code, that's why it is only 7 kb! Maybe you don't believe it, what about the textures? Yes, they're generated by code! This is also a test for my texture generator engine-a small tool to generate all kinds of textures using perlin noise. The textures of cloud and sea are created by it.


Saturday, August 30, 2008

My chatbot in Flash

flash as3.0 聊天机器人(点击展开中文翻译)

I was inspired by an interesting chatbot flash made by Chad Adams.
I can't fully understand his original class in flash mx, so just write one myself.
It costs me some time because I have to write the code while searching and learning what I need about XML.
I am not good at using action script to deal with XML and strings.
So no doubt the class can be improved.

Don't laugh at my bot, after all its brain only weighs 2 KB!
My chatbot source is Here: flash_chatbot_v1.0.rar
Chad Adams's original code is available at
All in all, this is one simple experiment. All it can do is to search the XML data (by Chad) to find answers according to some word you typed in and display the answers.

To extend my chatbot and make it more "clever", you can replace "brain.xml" with more complicated things such as "Artificial Intelligence Markup Language" and try to parser them:
and some open source chatbots based on AIML: chatterbot written in PHP and using MySQL.) (Flash AIML TTS Chatbot – ‘HAL9000′ using PHP and Festival)

By the way, if you are interested in chatbot, here are some links:
Some powerful chatbots are
they can say more and answer more questions.

Jamie Durrant offers us a tutorial about how to write a chatbot using what ALICE (above) knows(as2.0 or lower) with code here: .
What that flash file do is to replace the default html interface when using the AI chatbot at
Another Actionscript 3 Pandorabot Chat Class is here:

Finally, some flash chatbots:
by Billy T (nice UI !).
by Steve Worswick.

Monday, August 25, 2008

ray tracing in AS3.0

Flash 3D中最强的光影效果-光线追踪(点击展开中文翻译)

Recently I trying ray tracing in action script. Some ray tracer in flash I know is :
1.Strille’s raytracer_f9(nice effect, source not available ):

2.Forrest Briggs’ Real Time Ray Tracer in AS3(simple but effective):

3.non real time ray-tracing in flash-mx(flash-6):
(more controls, you can add light source, sphere, set texture)
Ross Richardson (simple and open source)
Ross Richardson’s source:

I rewrite Forrest Briggs’s source and add some controls(arrow &space&shift key to move the camera)and fake textures.


I also write one using the new Vector3D class for flash 10,but speed down to 3~5 fps! By the way, all above is mostly about Ray-tracing spheres so I also write one Ray-tracing triangle using Barycentric coordinate.

ray-tracing triangles
ray-tracing bump mapping
open source ray-tracing engine based on c++
The Basics of Raytracing
Another Raytracing experiment based on Forrest Briggs's work:
ASTrace Raytracing Library (Open Source, AS3)

Wednesday, August 20, 2008

3d slice engine in AS3.0


Ant Eden designed the 3D slice engine long ago, which extends the concept by rotating and scaling the slices in flash mx.

It's a pity I got to know that wonderful engine only about one year ago.
I'm sorry to found that not many people are talking about 3d slice nowadays.
"We already have more powerful 3d engine why waste time on those out-of-data & less effective stuffs?"

But it's really powerful when you want to make a 2D image looks like 3D.
Check the work in .
I'm sure no other flash 3d engine can make those works in such an easy way.

I really like this simple and useful tools,It's easy to understand and use. So if you want to make an eye that can move, create a face looks like 3D without 3D modeling, or if you don't want to use some 3D engine too complicated for your to understand, I recommend you to try it.

Good things should never die, so here is one example in AS3.0. I rewrite the original mx code, please don't fool me for my dirty code.

My 3d slice eye in AS3.0, source here or you may want to check the result first.

If you know nothing about 3D slice. Here is a simple tutorial by Ant Eden.
you can still find the source code of the book
'Flash 3D Cheats Most Wanted'(flash mx)
here , include source files of most flash related to 3D slice engine you see in
and finally, link to the old book:
"Flash 3D Cheats Most Wanted"

Read the book online: