|
TRIANGLES!!
It's all about triangles!! And matrix multiplication.
The thing about triangles is, a triangle in either 2D or 3D looks like a simple 2D triangle on your screen, no matter how you look at it.
One thing the graphics card does to make 3D happen is transform the points on all your triangles from the game world, to points on the screen.
In the world, they are 3D (x,y,z) points, but on your screen they are just 2D (x,y) points. A triangle made out of (x,y) points is really easy to draw, and yes the graphics card does that, and FAST. It's designed to fill pixels inside a triangle very fast. The color for each pixel can come from a texture (bitmap), lighting, shaders, fog, etc. and combinations of those.
The way your graphics card transforms points in 3D space to pixels on your screen is by using a transformation matrix.
A point in space is a vector, or "one-dimensional matrix", like this:
[code:1][[ 3.7]
[-12.1]
[169.6]][/code:1]
If you take that matrix and multiply it by a projection transformation matrix, the result will be the 2D (x,y) location where the point ends up on your screen, plus a depth value.
Although the graphics card does this work, the game programmer has to set up all the matrixes and decide exactly how they should work. The graphics card just takes them and multiplies really fast.
-----------------------------------------------------------------
Half-Life was not the first game to use bitmapped polygons, Doom, Wolfenstein, Magic Carpet and many more did this earlier. Not to mention Quake which Half-Life is based on.
|