|
Project: 3D Engine This is my second or third attempt at a good 3D engine. The first attempt was pretty sorry: no space partitioning or object-oriented programming: just a bunch of loosely related variables. The second was good but still no space partitioning or any other fancy effects. Try number 3 is doing great. Goals by the end include:
The program consists of a few different files each with a specific task. Octree.h controls dividing space up so only certain parts of the scene are drawn at once (the programming language I do does not automatically do it). Camera.h controls what you see. 3dmath.h is the file that does all the vector math for stuff like collision detection and all the other random polygon math. It also is a basic class for holding points. Here is the screenshot of the program originally (try #2, try#1 is long gone on my account at school). ![]() My eternal gratitude goes out to NeHe's incredible site. Without it I would know nothing. gametutorials.com helped me with the more advanced topics not necessarily related to OpenGL but a general understanding of theories. 6/18/03 First version available on the web. Features space partitioning, fog and collision detection. Still need to move some of the variables used in the first program over to camera.h (the class that will eventually make the viewing window act like a person). Heres a current screenshot. ![]() Download now: 3D Engine 6/18 - 693kb Note: You need to run the mapmake.exe file in the folder labeled data before the program will run properly. I will post the source code after the next major update. 7/25/03 Finished lighting. Its craptastic and only works because theres so many polygons close together (each polygon has its own luminosity which combines with polygons around it to produce the lighting). So in that respect I guess it is sub-OpenGL lighting (which is calculated per-vertex instead of per-polygon). On the upside, its FAST. None of that multitexturing crap. Heres a recent screenshot: ![]() It looks pretty good for a terrible illusion I think. BTW I promise ill post the source next time. Its a lot harder to zip than the exe :p. Anyways I also used an old physics formula to simulate gravity. If you fall too fast you sort of fall through the terrain though. Download the new version: 3D Engine 7/25 - 829kb 8/25/03 Took out lighting temporarily because it isn't very accurate with the new setup. Before it only worked because polygons were so close together and the lighting brightness of each polygon was determined by taking its average distance from the light source. Added multitextured terrain and a new way to make everything look more realistic. I got into terragen too (Get it here) and made a new skybox, which is basically the background. I'd say it looks a trifle better now: ![]() I finally found the time to post the source so here it is: 3D Engine 8/25 - 1307 kb |