Starting A 3D Engine
Question submitted by Fop (22 June 2000)




Return to The Archives
 
  I have a simple question for you. I want to make a 3d-engine but how do I start?  
 

 
  Usually, you'll need to start with some building blocks. I usually start with a vector library (points, vectors, planes, lines, matrices, etc.) Build a solid library and test it. It's very important that you get this right, because you will be relying on this throughout the rest of your development efforts.

Next, choose a 3D API and run with it. Build up a library that you are comfortable using, that performs all the necessary steps in the 3D API of your choice. Making this complete isn't as necessary. Yet.

Now you've spent some time writing code, and you've had time to ponder what you want from your engine. It's time to design it. If you're not big into design, then here are some very simple tips to get you started:
  • Decide what you want your engine to be capable of.
  • Decide what modules your engine will be comprised of (i.e. rendering, animation, etc.)
  • Decide how each module will work (which algorithm you'll use, etc.)
  • Figure out how all the modules will work together. This usually involves deciding on a good database structure and layout, so that the output from one piece fits nicely with the input of the next piece. If possible, make each module a black-box module, with the only common feature between them being a common data format.
  • Next, start coding your modules. It's very good to know that this process can get very tedious, depending on the scope of your engine. It's very hard to stay focused on an engine, no matter what the scope. I learned a long time ago, that I'm a visual person. I get gratification from my work when I reach a point where I have something really cool on the screen. So spread out your work such that you actually plan for those "gratification periods." They'll give you the boost you need to make it through the next batch of mindless typing.

    Most importantly, have fun. Learn a lot. Don't expect this engine to be the best thing ever. This is your first engine, so it's a learning experience. Your next engine will be a lot better. How do I know? Because by the time I was halfway through my fifth engine, I was already thinking how much better my sixth would be.

    Oh, and if you find yourself rewriting a lot of code over and over, don't worry, that's normal. It's called learning and improving. :)



    Response provided by Paul Nettle
     
     

    This article was originally an entry in flipCode's Ask Midnight, a Question and Answer column with Paul Nettle that's no longer active.


     

    Copyright 1999-2008 (C) FLIPCODE.COM and/or the original content author(s). All rights reserved.
    Please read our Terms, Conditions, and Privacy information.