Terrain in Away3D (Part 1)
User are always curious with the heights of Hills, Mountains and Depth of river and wells in the game.
He always thinks how these things are done.
By this blog you will have a fair idea about Height Maps, Alpha Maps used to make a terrain.
Terrain are always very important in games.
It comes with the combination of the following things,
1. Height Maps
2. Alpha Maps
3. Blending Texture
Here is the link for the Away3D
http://away3d.com/download/
Citrus provides you physics code for the Terrain
http://www.aymericlamboley.fr/blog/the-citrus-engine-meets-away3d/
I like the concept as they describe the way to use physics in the game
I have tried following code for the terrain.
var terrainMethod : TerrainDiffuseMethod = new TerrainDiffuseMethod([new BitmapTexture(Rock),new BitmapTexture(Grass), new BitmapTexture(Beach)], new BitmapTexture(Blend) , [25,25, 50, 25]);
var bmaterial : TextureMaterial = new TextureMaterial(new BitmapTexture(Albedo));
bmaterial.diffuseMethod = terrainMethod;
bmaterial.normalMap = new BitmapTexture(Normals);
// create the terrain mesh
terrain = new AWPTerrain(bmaterial, terrainBMD, 32000, 1500, 32000, 260, 250, 2000, 0, false);
//terrain = new AWPTerrain(bmaterial, terrainBMD, 19000, 1100, 19000, 200, 200, 1000, 0, false);
var terrainShape : AWPHeightfieldTerrainShape = new AWPHeightfieldTerrainShape(terrain);
terrainBody = new AWPRigidBody(terrainShape, terrain, 0);
and this runs perfectly. Be free to code.. :)
0 Comment(s)