Papervision 3D Programming Tutorial - Terrain
Learn how to create a realistic looking terrain mesh and texture that can be imported into Papervision. Demo and source code included.
VIEW THE DEMO
DOWNLOAD THE SOURCE
There are dozens of ways to create 3D terrain, and there are many examples of this being already being done in Flash. There aren't many examples in Papervision though, nor does Papervision support a standard terrain mesh.
My first instinct when looking to create a terrain mesh was to use a heightmap: a black and white image that defined the height of the terrain, which would then be mapped onto a plane. I then started to look around at optimisation techniques, and came up with a number of impressive sounding acronyms like CLOD and ROAM. A deeper look at the math and coding involved made me change my mind though.
So how do you create a good looking 3D terrain that runs reasonably well in Papervision?
Eventually I settled on simply doing all the processing an optimisation outside of Papervision, and import the whole thing as a simple mesh. You'll need two tools to do this for yourself.
The first is the T2 terrain generator, which you can download here. T2 allows you to create good looking terrain textures, complete with lighting and shadows, using a heightmap to define the topography of the terrain itself. You can then export this terrain to a mesh.
The second tool is Milkshape. Milkshape is a low polygon 3D editor, but I use it a lot for converting mesh formats, and for the plugins. One such plugin is called DirectX Mesh Tools. What it has to do with DirectX I don't know, but it can be used to reduce the number of polygons in a mesh without significantly reducing the quality of the model.
So you create a terrain mesh and texture in T2 and import it into Milkshape where you can reduce the number of polygons and then export it as a COLLADA file for Papervision. The end result is a 3D terrain that looks good and runs well.
In the demo use the WSAD keys to move around, and the R and F keys to raise or lower your height.
Check out more web development tutorials and articles here.
Go back to Papervision Tutorials

-
Papervision 3D Programming Tutorial - Terrain
| By mcasperson | in Programming
Learn how to create a realistic looking terrain mesh and texture that can be imported into Papervision. Demo and so...
-
Papervision 3D Programming Tutorial - Creating a Papervision Component
| By mcasperson | in Programming
See how Papervision can be packaged into a SWC Flash component, which allows you to drag and drop Papervision into ...
-
Papervision 3D Programming Tutorial - Traer Physics
| By mcasperson | in Programming
See how to implement cloth physics in Papervision 3D. Demo and source code included....
-
Papervision 3D Programming Tutorial - 3D Image Transitions
| By mcasperson | in Programming
Implement 3D image transitions with this Papervision demo . Source code and online example included....
-
Papervision 3D Programming Tutorial - Environment Mapping
| By mcasperson | in Programming
Learn how to implement environment mapping with Papervision....
-
iPhone Resizing a UIImage | By eh9212 | in Programming
How to resize a UIImage in a UIImageView and a UIButton...
-
Threading in dot net 2.0 - separate copy of static variable among different threads using ThreadStatic attribute | By xxris | in Programming
How each thread keeps a separate copy of same static variable using ThreadStatic attribute ....
-
ADAPATIVE ALGORITHM TO FINDOUT DUPLICATE RECORDS | By pinakbhusanmishra | in Programming
Records are list of row that are stored inside database . this is an efficient technique to find out the duplicatin...
-
ALGORITHM TO FIND OUT HIDDENLINKS IN WEBSITES | By pinakbhusanmishra | in Programming
Here we can find out the hidden links in the websites that basically people uses for the browsing ads....
-
PHP and MySQL | By ChaimChaikin | in Programming
PHP is a server side programming language that is used mainly for dynamically creating and mantaining websites. PHP...
-
AS3IsoLib Tutorial Series - Interaction | By mcasperson | in Programming
In this tutorial we add mouse interactivity to the scene....
-
AS3IsoLib Tutorial Series - Camera | By mcasperson | in Programming
In this tutorial we allow the view of the isometric scene to be moved with the mouse....
-
AS3IsoLib Tutorial Series - Height | By mcasperson | in Programming
In this tutorial we show the height of an isometric object by adding a shadow....
-
AS3IsoLib Tutorial Series - Materials | By mcasperson | in Programming
In this tutorial we modify the appearance of the isometric cube at runtime....
-
AS3IsoLib Tutorial Series - Moving Boxes | By mcasperson | in Programming
In this tutorial we add some animated isometric boxes to the scene....








No comments yet.