This project is a basic Minecraft-style voxel engine built using C++, OpenGL, GLFW, GLAD, and GLM. It features chunk-based terrain generation, player movement with gravity and jumping, basic collision detection, and textured cube rendering using a texture atlas.
- Each chunk is a 16×16×16 3D array of blocks.
- Procedural terrain generated with a sinusoidal heightmap.
- Blocks are rendered as cubes using indexed vertex data (VBO + EBO).
- Texture atlas support using UV mapping for multiple block types (grass, dirt, stone, etc.).
- FPS-style camera using
glm::lookAt. - Mouse-look support via GLFW cursor callback.
- WASD movement.
- Space to jump.
- Gravity is applied every frame.
- Player will fall until they hit the ground.
- Collision is calculated by checking the block below the player’s feet.
- Snaps camera to the top of the block on landing.
- Textures loaded using
stb_image. - Mipmaps enabled for better visual quality at a distance.
Screen.Recording.2025-07-29.221040.mp4
- GLFW – window/context/input
- GLAD – OpenGL function loader
- GLM – math library
- stb_image – image loader
- Make sure you have a C++17-compatible compiler.
- Install GLFW, GLAD, GLM, stb_image.
- Link OpenGL libraries.
- Build and run:
g++ main.cpp -lglfw -lGL -ldl -lX11 -lpthread -lm -o minecraft ./minecraft