How Is 3D Data Projected Onto A 2D Bitmap?

Started by
1 comment, last by Radikalizm 11 years, 10 months ago
[color=#333333][font=arial, helvetica, clean, sans-serif]

I am a C programmer, and recently found an interest in computer graphics. When a 3D model is drawn to the screen, it has to be put into a 2D bitmap, right? So how is 3D data projected onto a 2D bitmap that passes through the framebuffer onto the screen? I have heard the term "projection matrix" thrown about on forums, but I have no idea how you would use an array to project the 3D data onto the screen bitmap. How is this done?[/font]

C dominates the world of linear procedural computing, which won't advance. The future lies in MASSIVE parallelism.

Advertisement
http://en.wikipedia....i/3D_projection

Vertices are projected via matrix multiplication, then rasterization textures and shades the resulting on-screen pixels.
In standard rasterization engines you can express the process from getting a triangle-based 3D object from its local space to its projection onto a 2D plane as 3 transformations (ie. matrix multiplications)

The first one would be the world transformation where each vertex of the model is transformed to a position to the global or world coordinate space. The transformation is done by doing a matrix multiplication of your vertex positions with a world matrix which generally contains a translation, rotation and a scale factor.

The second transformation is the view transformation where your model is transformed from world-space to view-space using a view matrix. This transformation places the view point as the world origin (ie. at (0,0,0)).

The last transformation is the projection transformation which takes your view-space coordinates and projects them onto your final image. The projection matrix can hold info about your aspect ratio, clipping planes, field of view, etc.

This is just a very basic overview, there's tons of documentation to be found online about this process

I gets all your texture budgets!

This topic is closed to new replies.

Advertisement