Skip to content

0kzh/minicraft

Repository files navigation

Logo

Minicraft

A web-based Minecraft clone using THREE.js
Demo »

Report Bug · Request Feature

A Minecraft clone built in THREE.js as a final project for a graphics course at the University of Waterloo.

minecraft.mp4

Features

  • Voxel-based rendering system
  • Infinite world generation
  • Breaking/placing blocks
  • Tweened FOV changes when sprinting
  • Day/night cycles
  • Dynamic shadows based on sun position
  • Block lighting sources
  • Transparent blocks
  • Sound effects

Developing

Controls

  • WASD keys to move the player
  • Double tap W to sprint
  • Space to jump
  • Left click to break blocks
  • Right click to place blocks
  • Numbers 1-9 to cycle through toolbar
  • R to reset position
  • Esc to disable pointer-lock/go into orbit mode

Screenshots

Orbit view Orbit view

Procedurally generated ore Procedurally generated ore blocks

Render fog Render fog

Objectives

  1. Voxel Rendering System: Implement a voxel rendering system for a 3D matrix of blocks, each with unique properties like texture and translucency, and create a data structure and functions for rendering each voxel.

  2. Texture Mapping: Develop a texture mapping system to apply image textures to block faces, with support for transparency in textures for blocks such as leaves, grass, and water.

  3. Procedural Terrain Generation: Generate an infinite world using noise functions, rendering it in 16x16 chunks, with dynamic loading/unloading of chunks as the player moves, and adding fog for depth illusion. Ensure generated structures like trees render seamlessly between chunks.

  4. Performance Optimizations: Implement at least three optimizations for smooth browser gameplay

  5. Block Shading: Shade blocks based on their orientation relative to a simulated sunlight source.

  6. Player Physics and Collision Detection: Develop a simple physics engine for realistic player movement, including walking, jumping, and gravity, along with efficient collision detection to prevent passing through objects.

  7. Interactive Block Mechanics: Implement mechanics to allow players to break and place blocks, using raycasting for block detection, highlighting, and enabling block removal or placement.

  8. Skydome: Create a skydome encompassing the play area, with a dynamic day-night cycle that affects the world's lighting conditions, featuring transitions between dawn, daylight, dusk, and night.

  9. Procedural Generation of Environmental Structures: Algorithmically generate and place natural structures like trees and flowers, ensuring logical placement and natural patterns without unnatural overlaps.

  10. Lighting: Enhance the lighting engine to support day/night cycle effects and additional placeable light blocks which will influence the visibility and shading of nearby objects.

License

This project is licensed under the MIT License.

Sources

About

A web-based Minecraft clone, built with THREE.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published