Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Terrain in Away3D (Part 1)

    • 0
    • 5
    • 2
    • 1
    • 0
    • 0
    • 0
    • 0
    • 1.02k
    Comment on it

    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

    Citrus provides you physics code for the Terrain

    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)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: