terrain1.setMaterial(matTerrain); terrain1.setLocalTranslation(-256, -100, -256); terrain1.setLocalScale(1f, 1f, 1f); this.attachChild(terrain1); terrain2.setMaterial(matTerrain); terrain2.setLocalTranslation(-256, -100, 256); terrain2.setLocalScale(1f, 1f, 1f); this.attachChild(terrain2); terrain3.setMaterial(matTerrain); terrain3.setLocalTranslation(256, -100, -256); terrain3.setLocalScale(1f, 1f, 1f); this.attachChild(terrain3); terrain4.setMaterial(matTerrain); terrain4.setLocalTranslation(256, -100, 256); terrain4.setLocalScale(1f, 1f, 1f); this.attachChild(terrain4);
cameras.add(getCamera()); terrain.setMaterial(matRock); terrain.setLocalScale(new Vector3f(5, 5, 5)); terrain.setLocalTranslation(new Vector3f(0, -30, 0)); terrain.setLocked(false); // unlock it so we can edit the height
cameras.add(getCamera()); terrain.setMaterial(matRock); terrain.setLocalScale(new Vector3f(5, 5, 5)); terrain.setLocalTranslation(new Vector3f(0, -30, 0)); terrain.setLocked(false); // unlock it so we can edit the height
cameras.add(getCamera()); terrain.setMaterial(matRock); terrain.setLocalScale(new Vector3f(5, 5, 5)); terrain.setLocalTranslation(new Vector3f(0, -30, 0)); terrain.setLocked(false); // unlock it so we can edit the height
cameras.add(getCamera()); terrain.setMaterial(matRock); terrain.setLocalScale(new Vector3f(5, 5, 5)); terrain.setLocalTranslation(new Vector3f(0, -30, 0)); terrain.setLocked(false); // unlock it so we can edit the height
terrain.addControl(control); terrain.setMaterial(matRock); terrain.setLocalScale(new Vector3f(2, 2, 2));
terrain.addControl(control); terrain.setMaterial(matRock); terrain.setLocalScale(new Vector3f(2, 2, 2)); terrain.setLocked(false); // unlock it so we can edit the height
terrain.setMaterial(matTerrain); terrain.setLocalTranslation(0, -100, 0); terrain.setLocalScale(2.5f, 0.5f, 2.5f); rootNode.attachChild(terrain);
terrainQuad.setMaterial(matTerrain); terrainQuad.setLocalTranslation(0, -100, 0); terrainQuad.setLocalScale(4f, 0.25f, 4f); rootNode.attachChild(terrainQuad);
terrain.setLocalScale(2f, 1f, 2f); rootNode.attachChild(terrain);
terrain.addControl(control); terrain.setMaterial(matRock); terrain.setLocalScale(new Vector3f(2, 2, 2)); terrain.setLocked(false); // unlock it so we can edit the height rootNode.attachChild(terrain);
terrain.setMaterial(matRock); terrain.setLocalTranslation(0, -100, 0); terrain.setLocalScale(2f, 0.5f, 2f); rootNode.attachChild(terrain);
terrain.setMaterial(matRock); terrain.setLocalTranslation(0, -100, 0); terrain.setLocalScale(8f, 0.5f, 8f); rootNode.attachChild(terrain);
terrain.setLocalScale(2f, 1f, 2f); rootNode.attachChild(terrain);
terrain.updateModelBound(); terrain.setLocalTranslation(0, -100, 0); terrain.setLocalScale(1f, 1f, 1f); rootNode.attachChild(terrain);
terrain.setLocalScale(2f, 1f, 2f);
terrain.updateModelBound(); terrain.setLocalTranslation(0, -100, 0); terrain.setLocalScale(1f, 1f, 1f); rootNode.attachChild(terrain);
public void randomizeHeightMap() { if(terrain != null) { try { HillHeightMap heightmap = new HillHeightMap(513, 2000, 25, 100, (long)((byte)100 * Math.random())); Material mat = terrain.getMaterial(); Vector3f scale = terrain.getLocalScale(); Vector3f trans = terrain.getLocalTranslation(); rootNode.detachChildNamed("Terrain"); terrain = new TerrainQuad("Terrain", 65, 513, heightmap.getHeightMap()); terrain.setLocalTranslation(trans); terrain.setLocalScale(scale); terrain.setMaterial(mat); terrain.setShadowMode(ShadowMode.Receive); rootNode.attachChild(terrain); } catch(Exception ex) { ex.printStackTrace(); } } }
terrain.setLocalScale(localScale);
terrain.setLocalScale(localScale);