Lines Matching refs:terrain
37 import com.jme3.terrain.geomipmap.TerrainLodControl;
38 import com.jme3.terrain.geomipmap.TerrainQuad;
39 import com.jme3.terrain.geomipmap.lodcalc.DistanceLodCalculator;
40 import com.jme3.terrain.heightmap.AbstractHeightMap;
41 import com.jme3.terrain.heightmap.ImageBasedHeightMap;
47 private TerrainQuad terrain;
59 /** 1. Create terrain material and load four textures into it. */
61 "Common/MatDefs/Terrain/Terrain.j3md");
65 "Textures/Terrain/splat/alphamap.png"));
69 "Textures/Terrain/splat/grass.jpg");
76 "Textures/Terrain/splat/dirt.jpg");
83 "Textures/Terrain/splat/road.jpg");
91 "Textures/Terrain/splat/mountains512.png");
96 * Now we create the actual terrain:
97 * 3.1) Create a TerrainQuad and name it "my terrain".
98 * 3.2) A good value for terrain tiles is 64x64 -- so we supply 64+1=65.
104 terrain = new TerrainQuad("my terrain", patchSize, 513, heightmap.getHeightMap());
106 /** 4. We give the terrain its material, position & scale it, and attach it. */
107 terrain.setMaterial(mat_terrain);
108 terrain.setLocalTranslation(0, -100, 0);
109 terrain.setLocalScale(2f, 1f, 2f);
110 rootNode.attachChild(terrain);
113 TerrainLodControl control = new TerrainLodControl(terrain, getCamera());
115 terrain.addControl(control);