Skip to content

ryanfitzpatrickio/terrain_miner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scalar Mine

Scalar Mine is a browser-based terrain mining prototype built with Svelte, Vite, and Three.js. It generates chunked scalar-field terrain, lets you dig smooth holes into the ground, and remeshes edited chunks in the background with a worker pool.

The terrain is SDF-like: solid ground and empty space are represented as a density field, and digging subtracts smooth spherical edits from that field. Chunks are rebuilt from the density == 0 surface, which avoids mesh boolean artifacts and keeps holes clean.

Features

  • Infinite-feeling chunked terrain around the player
  • Smooth spherical digging with a visible brush preview
  • Capsule character movement and terrain collision
  • Camera collision that avoids clipping through the ground
  • Background chunk meshing with ?pool=false available for sync-mode debugging

Controls

  • WASD move
  • Space jump
  • Shift sprint
  • Mouse move to look after pointer lock
  • Left click dig
  • Mouse wheel changes brush size
  • Shift + mouse wheel zooms the camera

Run

npm install
npm run dev

Open the local Vite URL in your browser. Use ?pool=false to disable worker pools for comparison.

About

Scalar Mine is a browser-based terrain mining prototype built with Svelte, Vite, and Three.js. It generates chunked scalar-field terrain, lets you dig smooth holes into the ground, and remeshes edited chunks in the background with a worker pool.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors