@ -1,5 +1,5 @@
import {
import {
PlaneBuffer Geometry ,
PlaneGeometry ,
MeshStandardMaterial ,
MeshStandardMaterial ,
Mesh ,
Mesh ,
TextureLoader ,
TextureLoader ,
@ -9,7 +9,7 @@ export default function createTerrain(props) {
const loader = new TextureLoader ( ) ;
const loader = new TextureLoader ( ) ;
const height = loader . load ( "img/textures/height.png" ) ;
const height = loader . load ( "img/textures/height.png" ) ;
// w h
// w h
const geometry = new PlaneBuffer Geometry ( 150 , 150 , 64 , 64 ) ;
const geometry = new PlaneGeometry ( 150 , 150 , 64 , 64 ) ;
const material = new MeshStandardMaterial ( {
const material = new MeshStandardMaterial ( {
color : props . color ,
color : props . color ,
@ -35,7 +35,7 @@ export default function createTerrain(props) {
plane . geometry . attributes . position . randomValues = props . randVertexArr ;
plane . geometry . attributes . position . randomValues = props . randVertexArr ;
let frame = 0 ;
let frame = 0 ;
plane . tick = ( delta ) => {
plane . tick = ( ) => {
frame += 0.01 ;
frame += 0.01 ;
// destructuring of the random values, the original position and the current vertex position
// destructuring of the random values, the original position and the current vertex position
const { array , originalPosition , randomValues } =
const { array , originalPosition , randomValues } =