|
|
@ -8,15 +8,16 @@ import { |
|
|
|
|
|
|
|
export function createTerrain(props) { |
|
|
|
const loader = new TextureLoader(); |
|
|
|
const height = loader.load("img/textures/height.png"); |
|
|
|
const height = loader.load("img/textures/forest-floor.png"); |
|
|
|
// w h
|
|
|
|
const geometry = new PlaneGeometry(150, 150, 64, 64); |
|
|
|
const geometry = new PlaneGeometry(100, 100, 64, 64); |
|
|
|
|
|
|
|
const material = new MeshLambertMaterial({ |
|
|
|
color: props.color, |
|
|
|
flatShading: true, |
|
|
|
displacementMap: height, |
|
|
|
displacementScale: 5, |
|
|
|
map: height, |
|
|
|
//displacementMap: height,
|
|
|
|
//displacementScale: 5,
|
|
|
|
}); |
|
|
|
|
|
|
|
const plane = new Mesh(geometry, material); |
|
|
|