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 - 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 - Environment Mapping
| By mcasperson | in Programming
Learn how to implement environment mapping with Papervision....
-
Papervision 3D Programming Tutorial - Texture Smoothing
| By mcasperson | in Programming
See the difference texture smoothing can make to your Papervision 3D applications. Demo and source code included....
-
Papervision 3D programming tutorials - Clipping & Culling
| By mcasperson | in Programming
See how to use Papervisions clipping and culling options to improve performance and visual integrity. Demo and sour...
-
XA Transaction - Solution for Transaction More Than One Database | By H4d1 | in Programming
Have you ever think that it's too difficult for making database transaction in two different places (or databases) ...
-
Javascript functions for : trim, right trim, left trim, no Apostrophe, is Empty , is Digit , VarChar To Number , is integer , check Is Zero , Get Que | By xxris | in Programming
Javascript functions for : trim, right trim, left trim, no Apostrophe, is Empty , is Digit , VarChar To Number , i...
-
How to access and use a Window's command line | By MaxwellPayne | in Programming
Learn about the Window's command line in DOS and how to use it....
-
How to Learn to Program Your Computer | By dsj8760 | in Programming
This article is about learning to program a computer. It is a general article giving tips on how to learn about pro...
-
Jailbroken iPhones get RickRolled | By explorer | in Programming
First iPhone worm, attacks via SSH and does the classic rick roll gag on the user....
-
Away3D Programming Tutorial - Environment Material | By mcasperson | in Programming
See how to use the EnviroBitmapMaterial to create a real time reflective look in Away3D. Demo and source code inclu...
-
Away3D Programming Tutorial - Primitives | By mcasperson | in Programming
See how easy it is to use the build in primitive shapes supplied with Away3D. Demo and source code included....
-
Away3D Programming Tutorial - Mouse Interaction | By mcasperson | in Programming
Learn how to respond to mouse events in Away3D. Demo and source code included....
-
Away3D Programming Tutorial - Effects | By mcasperson | in Programming
See how you can add the standard Flash filters to any Away3D object to easily create advanced effects. Demo and sou...
-
Away3D Programming Tutorials - Getting Started | By mcasperson | in Programming
Learn how to get started with the Away3D Flash 3D engine with this detailed, step by step tutorial. Demo and source...








No comments yet.