Skip to content

Latest commit

History

41 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Tile terrain for Three.js

  • creates a Three geometry
  • displays grid/edges (createLines)
  • raise method for raising terrain at given tile (use negative values for lower terrain)

Example:

constmaterial=newTHREE.MeshLambertMaterial({color: '#33ff33',flatShading: true,});constmesh=newTHREE.Mesh(newTHREE.BufferGeometry(),material);constterrain=createTerrain({tile: {x:0,y:0,z:0},rows: 32,columns: 32,tileSize: 1,onChange: ({ geometry })=>{mesh.geometry=geometry;},use: {THREE,},});terrain.raise({x: 2,y: 3});terrain.raise({x: 5,y: 5});terrain.raise({x: 20,y: 20});setTimeout(()=>{terrain.raise({x: 21,y: 20});terrain.raise({x: 20,y: 20},3);},2000);

No more docs for now. You can look into source code. Module works but API can change.

Module was extracted from bigger project: https://looptile.netlify.app/ It's a 3D tile editor.

Screenshot

About

Tile terrain for Three.js

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages