3D programming w/o 3D-libraries

Started by
3 comments, last by CaveDweller 17 years, 5 months ago
Hello, again bothering you with questions. \o I have had some information from the programming "gurus", and they say that I should start 3D-programming by learning the theory and to learn how to do it without any helping libraries. I know that this requires some serious maths, but can you suggest any sites that deal with this issue? Sorry if a topic like this exists, but the search doesn't work on my browser or something, I'm not getting any results. :-) Edit, and if possible, in C/C++, because I prefer some examples also, not just the pseudo and theory.
The important thing is to never stop questioning. - Albert Einstein
Advertisement
Flipcode.com has plenty of articles on 3D math and 3D graphics programming. Also you can look at Tricks of the 3D Game Programming Gurus. That book writes a Quake 1-like graphics engine from scratch (ie. no D3D, no OGL).

Beginner in Game Development?  Read here. And read here.

 

Well yea it can be done pretty easy in software (slow as balls). I don't know how easy it is to interface with hardware.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

In my introductory graphics course in college, we each built our own real-time rendering engine from high level application down to rasterization. openGL was used to output our final matrix of pixel values to screen.

If you're learning on your own (and depending on your level of expertise), I'd recommend starting with the easier goal of learning basic transforms and projections. If you can get a working program to transform triangles from 'object space' to 'screen space' and then output them using DirectX's screen coordinate triangle specification, then you'd be well on your way to learning much of the basic math that goes into computer graphics.

In other words, your program would do the following:
-Allow specification of triangles in object coordinates (by reading in a mesh or specifying the coordinates directly).
-Transform all objects into uniform 'world coordinates'. Ideally, you'd have several objects with different local transform matrices. Even better would be creating a scene graph hiearchy to operate on groups of objects.
-Transform objects into 'camera space' using an inverse camera transform
-Project vertices to 'screen space' using a perspective projection matrix
-Use DirectX (or openGL) to output the triangles, specified in screen coordinates.

All of the above concepts are covered in many introductory graphics books. I can highly recommend the latest edition of "Real Time Rendering" (Haines and Moller), which provides concise coverage of the basics and an extensive array of more advanced graphics topics.

Another thing you might consider is checking out the websites for college graphics courses. These quarterly sites often provide assignments similar to the one above, sometimes including sample code and even lecture slides. Many are password-protected, but there are a great deal of major universities that don't secure these sites (mine included).

Hope that helps.
My favorite book for learning pure software rendering was Sergei Savchenko's "3D Graphics Programming: Games and Beyond". It covers the theory extremely well, covers the math fairly well (you will probably want to read some supplemental articles) and includes a relatively simple software renderer on the accompanying CD. You could probably get a used copy for 10 or 15 bucks from Amazon.

This topic is closed to new replies.

Advertisement