# 3D programming w/o 3D-libraries

This topic is 4035 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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.

##### Share on other sites
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).

##### Share on other sites
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.

##### Share on other sites
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.

##### Share on other sites
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.

##### Share on other sites

This topic is 4035 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628694
• Total Posts
2984253

• 16
• 13
• 13
• 10
• 10