The camera movement is pretty straightforward. Since the screen can’t move, just move everything around. But since there is lot’s of math to do I had some bugs like these:
Then I tried to turn the square into a cube and rotate that. Note for future a box rotating vertically is weird without the perspective.
Here is a shot when the box didn’t want to be a box:
—- |
And here is a box rotating vertically in front of you:
But then I just studied the math behind it and suddenly all my coding problems went away too. Here is a good looking box:
Isn’t it beautiful?
After that, I dressed up my little box. First, it didn’t want to wear anything. Then it wore a dirt texture and finally grass texture. I want to point out that the box is my limitation with aesthetics. I am a left-brain guy.
This is not a big thing. But I realized with a skybox everything looked a little better. It made the game a whole.
As other programmers would know, If I can create one from one thing then I can create an array of the same thing.
After that, I became curious about how to ray trace player’s selection. So I made a box removal task. Just to try out and it worked perfectly. Now I could draw on my game.
But let’s get real this is nothing compared to Minecraft’s massive maps. So buckle up. After my floor of grass, I made some map generations.
But it was so massive it only had a couple of fps while rendering. And yes this is where I implemented fps counter as well. Because I needed a statistic about my performances. After a little playing around I found a better size for my chunks and I added render range. Render range helped me not to render the whole map.
Here is my diameter of rendering:
Then, my imagination went wild.
In the end, I decided to go with this kind of a map style:
I didn’t like that my map is limited. So I made a map generation system. That created new chunks as I moved. There were some bugs at the beginning,
But it worked in the end.
This is where I left my game. The save system is tricky and it needs the whole game’s system plans to work.
This is how I fell in love with computer graphics. I love this project and maybe I will continue on this. But my main focus is now finishing a project and this one will never be finished. Because as original Minecraft, I can add new things all the time.
The video of this project may take a while. There is too much footage to edit.
I am not an OpenGL Guru but I will be glad to respond to any questions!