Sat. Jan 21st, 2023

3D Image representation

3D space is modelled using x, y and z axes. While we are all familiar with simple x and y coordinates (y increases as it moves us, and x increases as it moves to the right), there can be ambiguity about what happens to the z axes.

Consider a 2D game, a Photoshop project, or a Flash project. All of these use layers. The layer is often referred to as the z-index. The higher this value is, the closer to the top the item is. In this scheme, higher z values are closer to us.

Alternatively, in 3D space, you will often find that increasing the z value results in an item moving further away from you – that is, the higher the value, the more distant the object.

Left or Right handed?

Using your middle finger to represent y, and your index finger as x, your thumb becomes the z axis – depending on whether you use your left or right hand, z either runs into the page (left handed) or out of the page (right handed).

Clearly, left- and right- handed are simply different ways of representing the same information; however, always be sure you are using the same system as anyone you collaborate with!

Local coordinate systems

Objects in 3D space must have an x, y and z coordinate to position them. You could assign a global coordinate to every item: everything would be relative to the origin, (0,0,0).

An alternative is to treat grouped points differently (the points making up an object); these would use a local coordinate system: that is, the x,y and z are the coordinates relative to an anchor point. For instance, a cube may have one corner positioned in global space, but the coordinates of the other corners are all relative to that initial corner.

3D world

This is your entire ‘map’ or world.

3D viewport

The viewport is a (usually) rectangular 2D window into the 3D world. The viewport is the window where a 2D view of the world is presented. It is also defined as an area “expressed in rendering-device-specific coordinates, e.g. pixels for screen coordinates, in which the objects of interest are going to be rendered”

Camera

When humans view the natural world around them, they see two subtly different versions of the same image – one from each eye.

The brain can process the differences between these images and map the 2D views into a 3D image.

In this scenario, your eyes are the cameras – they are ‘rendering’ the 2D representation of the 3D world. However, a camera can do far more than this.

If you wear glasses, you will be aware that the apparent size of everything appears to differ between glasses-on and glasses-off. A similar effect can be achieved by changing the focal length of a camera lens; some elements can be compressed, some can be exaggerated. In a rendering of a 3D scene, the same applies to the camera.

Wide angle lenses over-emphasise objects that are close to it, giving a distorted view. They give a good impression of depth in scenes. In contrast, a more zoomed lens gives a very ‘flat’ impression of an image. Image from https://www.photographymad.com/pages/view/wide-angle-lenses

In addition, effects such as lens flare, chromatic aberration and much more can be added via the camera.

Geometrical primitives

As with 2D vector images, 3D images are created using points and lines. A mesh which represents the surface of a 3D object can be created using points and lines.