Woot my first 3D engine

masshuu

Head of the Geese
Community Support
Enemy of the State
Messages
2,293
Reaction score
50
Points
48
http://www.youtube.com/watch?v=Hwni-zx6QhI

I have never done any kind of 3D before so this was a huge leap.
This took me about 5 hours over 2 days to figure out how to do this. It is not at all optimized and it has so much more work to do. I have gotten up to ~ 3 million blocks, at which point the frames/sec drop to ~ 1-2

I realize there isn't much to see, but given i have never done anything 3D related and this is only ~5 hours of work, i am fairly happy about it.

This is done in C# with OpenGL Via OpenTK
The hardest part was the camera, as there are almost no tutorials on a first person tutorial. The few that i did find were in C++ and there were some differences between OpenTK's Wrapper and the calls OpenGL has in c++


I started out with the cube demo, drawing 2 cubes, then 10, then 100. I quickly realized this was very inefficient as half the time, a cube wasn't even visible. Even if it was, only 2-3 sides of it were visible. I Switched to drawing individual sides(I have no clue how minecraft does it, i would assume Notch only draws visible sides as it is way more efficient.) and after figuring out how to group up sides into a bunch of larger VBOs, i went from drawing 100 blocks to drawing 500,000 blocks, though this video only shows ~ 230,000 blocks.
The pauses are due to me hitting Enter, which regenerated the whole map(You can see the changes after about a second)
 
Top