Background

This section will go over some of the background information that you will need to understand in order to deal with 3D graphics. It includes things like terminology, and background. You may have encountered these concepts in other 3D courses but it is a good idea to do a review.

3D coordinate systems

There are many slightly different 3D coordinate systems. These coordinate systems will affect the way that things are calculated and represented. When a model is created, it could be done in one system and then when it is used by an application like a game, it could be in a completely different system. This is why it is important to know the system you are working in.

Left hand vs right hand

Let's begin our talk on coordinate systems by looking at left vs right handed, Y-Up systems. Direct-X uses a left handed system. openGL uses a right handed system.

So, why are they called what they are called....

Take your left hand, extend your fore finger and thumb so that your fore finger points up, and your thumb points to the right. Your thumb now points to positive X while your fore finger to positive Y. Now, extend your third finger, and the only way it can point is away from you (or into the screen). This is the direction of positive Z. You won't be able to make your third finger point out without doing some serious damage to yourself.

Similarly if you make your thumb on the right hand point to positive X, fore finger on right hand point to positive Y, your third finger would have to point at you (or out from screen). In a right-handed system, your third finger is now pointing in the direction of positive Z.

As you can see, between left-handed and right-handed systems, positive Y and positive X match directions, while positive Z is mirrored depending on the choice of system. This is why left-handed vs right-handed is an important choice when designing a 3D system.

Z-UP vs Y-UP

In a 3D coordinate system, the idea of "up" is purely semantic. That's to say, it does not affect objects within the coordinate system (unlike left-handed vs right-handed), it simply affects how we interpret the coordinate system.

There are two popular choices for the "up" axis. Those are Z-up and Y-up. Z-up means that the Z axis goes up and down where as Y-up means the that the Y axis goes up and down.

3DS Max is a right handed Z-Up coordinate system. In other words, it follows right handed coord system rules but instead of the floor being the XZ plane, it defines the floor as the XY plane:

Basic 3D representation

Shape

3D models are made up of a series of triangles all of which are completely flat. That is if we were to look at each of the 3 corners of a triangle, all 3 would be on the same plane. multiple triangles that are adjacent to each other form meshes. While each individual triangle must be flat, the triangles within a mesh do not need to be co-planar. the edge between two triangle allows for the creation of curves.

Programmatically a mesh is stored as a series of vertices and edges that make up a number of faces. Each vertex is described as simply 3 values, x, y and z. These values represent the location of the vertex in 3D space. An edge, describes the connection between two vertices. A face is described by 3 or more vertices given in a particular order. Exactly how the data is stored and represented can be different between different 3D applications and thus, understanding that is key when you have to deal with the models programmatically.

In the end, what we need to understand is that the more triangles we have, the more data must be stored which can then have an affect rendering time.

Textures

The values of the vertices only define the shape of the object. In order to create details (like adding writing to a sign for example) we need to apply a texture to a mesh. A texture is simply a 2D image that is pinned to the mesh. Each face is laid out onto a 2D surface and the portion of the texture within that face is applied to the surface of the 3D mesh.

The location of each vertex of each face on this image is represented by 2 values, the u and v coordinates. If the u and v coordinates are different, the image will be laid out in a different manner on the object. In the picture below, two identical spheres have the same texture applied to it. However, they each have a different uv layout. Thus, the resulting spheres have a different pattern on it.

Last updated