CrashCourse · @crashcourse
3D Graphics: Crash Course Computer Science #27
Uploaded June 8, 2018 · Length 12:41
Summary
Learn how 3D graphics are rendered on a 2D screen using projection, wireframe rendering, scanline rendering, and Z-buffering.
- 3d graphics rendering
- computer science basics
- wireframe models
- scanline algorithm
- z-buffering explained
- 3d projection types
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:03
Hi, I’m Carrie Anne, and welcome to CrashCourse Computer Science!
- 0:05
Over the past five episodes, we’ve worked up from text-based teletype interfaces to
- 0:10
pixelated bitmapped graphics. Then, last episode, we covered Graphical User Interfaces and all
- 0:15
their “Ooey Gooey” richness.
- 0:17
All of these examples have been 2D. But of course “we are living in a 3D world, and
- 0:21
I’m a 3 dimensional girl!”
- 0:23
So today, we're going to talk about some fundamental methods in 3D computer graphics and how you
- 0:27
render them onto a 2D screen.
- 0:29
INTRO
- 0:38
As we discussed in episode 24 we can write functions that draw a line between any two points like A and B.
- 0:44
By manipulating the X and Y coordinates of points A and B, we can manipulate the line.
- 0:49
In 3D graphics, points have not just two coordinates, but three -- X, Y and Z. Or “zee” but
- 0:55
I’m going to say “zed”.
- 0:56
Of course, we don’t have X/Y/Z coordinates on a 2D computer screen, so graphics algorithms
- 1:01
are responsible for “flattening” 3D coordinates onto a 2D plane.
- 1:05
This process is known as 3D Projection. Once all of the points have been converted from
- 1:09
3D to 2D, we can use the regular 2D line drawing function to connect the dots… literally.
- 1:15
This is called Wireframe Rendering.
- 1:17
Imagine building a cube out of chopsticks, and shining a flashlight on it. The shadow
- 1:21
it casts onto your wall – its projection – is flat. If you rotate the cube around,
- 1:25
you can see it’s a 3D object, even though it’s a flat projection.
- 1:29
This transformation from 3D to 2D is exactly what your computer is doing, just with a lot
- 1:34
more math… and less chopsticks.
- 1:36
There are several types of 3D Projection. What you’re seeing right now is an Orthographic
- 1:41
Projection, where, for example, the parallel sides in the cube appear as parallel in the
- 1:46
projection.
- 1:47
In the real 3D world through, parallel lines converge as they get further from the viewer,
- 1:50
like a road going to the horizon. This type of 3D projection is called Perspective Projection.
- 1:56
It’s the same process, just with different math. Sometimes you want perspective and sometimes


