No history yet

Introduction to 3D Graphics

Locating Points in Space

To create a 3D world on a computer, we first need a way to describe where everything is. We do this using a 3D Cartesian coordinate system. It’s like a map, but with an extra dimension for height.

Imagine the corner of a room. The line where the two walls meet the floor can be the Y-axis (up and down). The lines where each wall meets the floor can be the X-axis (left and right) and the Z-axis (forward and backward). Any point in the room can be described by three numbers: its distance along the x-axis, its distance along the y-axis, and its distance along the z-axis. We write this as (x,y,z)(x, y, z). The corner itself, where the axes meet, is the origin, or (0,0,0)(0, 0, 0).

With this system, we can define the vertices of any 3D object, from a simple cube to a complex character model, and place them precisely within our virtual world.

Moving, Turning, and Resizing

Once we have objects in our 3D space, we need to be able to manipulate them. The three most basic operations are translation, rotation, and scaling. These are collectively known as transformations.

  • Translation simply means moving an object from one place to another. We add or subtract values from its coordinates. For example, to move an object 5 units along the X-axis, we add 5 to the x-coordinate of all its vertices.

  • Rotation involves spinning an object around one of the axes (X, Y, or Z). This changes the orientation of the object without moving its center point.

  • Scaling changes the size of an object. We can scale it uniformly to make it bigger or smaller in all directions, or non-uniformly to stretch or squash it along a specific axis.

These three transformations are the building blocks for almost all motion and animation you see in 3D graphics.

Mathematically, all these transformations can be performed efficiently using matrix multiplication. This is where a clever trick comes in handy: homogeneous coordinates. By adding a fourth number, ww, to our (x,y,z)(x, y, z) coordinates, we create (x,y,z,w)(x, y, z, w). For 3D points, this ww is usually set to 1. This system allows us to represent all three types of transformations (and more) as a single matrix operation, which is very efficient for computer hardware.

From 3D Scene to 2D Screen

Our computer screen is a flat, 2D surface. So how does a 3D scene get turned into a 2D image? This happens through a process called the rendering pipeline. Think of it as an assembly line for creating an image. The main stages are:

  1. Modeling: First, the 3D objects themselves are created. These are usually collections of vertices that form polygons, typically triangles.

  2. Transformation: The 3D models are scaled, rotated, and translated into their correct positions in the scene. This is often called placing objects in "world space."

  3. Lighting: The computer calculates how light sources in the scene interact with the surfaces of the objects. This determines which parts are bright, which are dark, and where shadows fall.

  4. Projection: This is the crucial step where the 3D world is flattened into a 2D image. The computer calculates what the scene looks like from the perspective of a virtual camera. Objects farther away appear smaller, just as they do in real life.

  5. Rasterization: In the final stage, the projected 2D shapes are converted into pixels on your screen. The computer goes through each pixel and determines its final color based on the object, material, and lighting information. The result is the image you see.

These core concepts—coordinates, transformations, and the rendering pipeline—form the foundation of all 3D graphics, from simple games to blockbuster visual effects.

Quiz Questions 1/5

In a 3D Cartesian coordinate system, what does the point (0, 0, 0) represent?

Quiz Questions 2/5

Which transformation changes an object's orientation in space without moving its center?