Skip to content

Minecraft clone in Three.js using instancing and Perlin noise (terrain generation)

Notifications You must be signed in to change notification settings

valentecaio/aiocraft

Repository files navigation

AioCraft

Try it at valentecaio.ovh/aiocraft.

screenshot1.png

AioCraft is a first-person game built with the Three.js library. It uses GPU instancing to render a scene composed of texels (cubes) which are randomly generated from a Perlin noise function. The collision and gravity are handled using the native ray tracing Three.js module.

For more information, see this presentation (in Portuguese) ot this demonstration video.


Controls

Keys Function
WASD Walk
Space Jump
Mouse Camera control
R FPS show on/off
F Gravity on/off
Up/Down Teleport vertically
Left/Right Increase/decrease movement speed

How to execute

To run this project locally, follow the steps below.

  1. Install Node.js from nodejs.org.
  2. Install the dependencies: $ npm install
  3. Run the node server: $ npm run dev
  4. Access the application at localhost:5173 in a browser.

Different types of terrain

The terrain generation method can be easily adapted to generate different types of terrain, such as the examples below:

screenshot2.png

screenshot3.png