Mini Minecraft
CIS560: Introduction to Computer Graphics — Fall 2019
C++, OpenGL
Overview
As a part of my core curriculum for my Computer Graphics (Digital Media Design) major, I took an Introduction to Computer Graphics course. This course covers topics relating to the technical aspects of 3D modeling, such as viewing transformations, polygon and mesh data structures, the render pipeline, and more. The assignments are in C++ and OpenGL.
One of our main projects involved creating a miniature version of Minecraft with teammates, implementing different graphics related elements into the Minecraft system. I worked with Weiyu Du and Han Yan.
Features and Contributions: Saranya
I implemented the procedural terrain as a part of the first milestone. I chose to implement my chosen feature by using fractal brownian motion (FBM), and I used 2D FBM to create procedural noise. In addition, I implemented the ray casting to allow the users to add blocks and remove blocks based on where they are facing. I used the ray marching method of starting from the “eye” to see where the position of the character is and using the “look” vector to see where the character is looking. Then, using an incrementing value (“t”), I was able to ray march and find block intersections. For removing blocks, I simply removed the intersected block. For adding blocks, I found the exact cube intersection and the face and direction to which I need to add the block.
For the second milestone, I implemented L-System rivers. I did so by creating a turtle class and kept track of the position and orientation of the turtle. Using grid intersections at each step of creating the river, I was able to draw between each current and previous turtle to create a series of lines that would represent the schema of the river to be placed in Minecraft. Through creating a set of grammar rules, I was able to create a linear river and a delta river to render on the first chunks of land that the player starts in. The river branches out and also has walls that are “cut out” with staggered block walls to make it look more like a natural river rather than blocks that have just been deleted at an arbitrary location.
For the last part of the project, I created the GUI for Minecraft. In this GUI, I made use of shaders and textures to create a GUI inventory, which users can click on different blocks that they want to be able to put down. I wrote functionality such that when the player pulls up the inventory, it's similar to "pausing" the game (i.e. player does not move) and the mouse icon appears so that the player can see where they are clicking, and click on the appropriate type of block that they want to put down.
Another feature that I added was the ability to load in .obj files. Using a program called MagicaVoxel, I made a little turtle monster (his name is Burtle, because he looks like a burger) and he is a static asset, placed on the terrain. To make him look a little more animated, I applied an animation to the texture that makes him appear in psychedelic colors. He's a fun addition to Minecraft and gives our terrain a little more personality!
We also chose to implement biomes as an environmental change in Minecraft. I helped conceptualize how to implement biomes (i.e. what classes we should modify, what types of biomes to add, how to create them), and Han Yan actually implemented the additions to the chunking class.
Features and Contributions: Weiyu Du
For the first milestone, Weiyu implemented terrain expansion and efficient rendering and chunking. She implemented a chunk class and set up interleaved vertex buffer objects (VBOs) to complete this.
For the second milestone, she implemented texturing and texture animation for the Minecraft blocks. She loaded images as textures and created a Blinn-Phong specular reflection model to be used depending on the type of block. The animated block types are water and lava.
For the last part of the project, Weiyu implemented a day and night cycle, distance fog, procedural grass color, and procedurally placed objects.
Features and Contributions: Han Yan
For the first milestone, she implemented player physics by creating a player class and player controllers to update the velocity and position of the player according to input from the mouse. Additionally, she implemented collision physics with blocks.
For the second milestone, she implemented swimming and multi-threading features. For the swimming physics, the player determines whether or not it is in water or lava (as opposed to walking on ground or flying) and updates the velocity accordingly. For multithreading, she used threads to take care of the FBM calculations needed for chunk generation.
For the final project of the project, she implemented a post-process camera overlay for when the player is submerged in water or lava, turning the screen a transparent blue or red respectively. She also implemented sound effects for walking and swimming, along with creating four different biomes (grassland, lava, iceland, and stoneland).
Final Results