Blender 3D: Noob to Pro/Coordinate Spaces in Blender
We'll start looking at how 3D scenes are represented in Blender.
As was explained in the "3D Geometry" module, Blender represents locations in a scene by their coordinates. The coordinates of a location consist of three numbers that define its distance and direction from a fixed origin. More precisely:
- The first (or x-) coordinate of the location is defined as its distance from the YZ plane (the one containing both the Y and Z axes). Locations on the +X side of this plane are assigned positive x-coordinates, and those on the -X side are given negative ones.
- Its second (or y-) coordinate is its distance from the XZ plane, with locations on the -Y side of this plane having negative y-coordinates.
- Its third (or z-) coordinate is its distance from the XY plane, with locations on the -Z side of this plane having negative z-coordinates.
Thus the origin (which lies at the junction of all three axes and all three planes) has the coordinates (0, 0, 0).
Global and local coordinates[edit | edit source]
Blender refers to the coordinate system described above as the global coordinate system, though it's not truly global as each scene has its own global coordinate system. Each global coordinate system has a fixed origin and a fixed orientation, but we can view it from different angles by moving a virtual camera through the scene and/or rotating the camera.
Global coordinates are adequate for scenes containing a single fixed object and scenes in which each object is merely a single point in the scene. When dealing with objects that move around (or multiple objects with sizes and shapes), it's helpful to define a local coordinate system for each object, i.e. a coordinate system that can move with, and follow the object. The origin of an object's local coordinate system is often called the center of the object although it needn't coincide with the geometrical center of the object.
3D objects in Blender are largely described using vertices (points in the object, singular form: vertex). The global coordinates of a vertex depend on:
- the (x, y, z) coordinates of the vertex in the object's local coordinate system
- the location of the object's center
- any rotation (turning) of the local coordinates system relative to the global coordinate system, and
- any scaling (magnification or reduction) of the local coordinate system relative to the global coordinate system.
For example, the teacup in Figure 1 is described by a mesh model containing 171 vertices, each having a different set of local (x, y, z) coordinates relative to the cup's center. If you translate the cup (move it without rotating it), the only bits of the model that have to change are the global coordinates of the center. The local coordinates of all its vertices would remain the same.
Coordinates of child objects[edit | edit source]
Any object can act as a parent for one or more other objects in the same scene, which are then referred to as its children. (An object cannot have more than one direct parent, but parent objects may themselves be the children of other objects.)
If an object has a parent, its position, rotation, and scaling are measured in the parent's local coordinate system, almost as if it were a vertex of the parent. i.e. the position of the child's center is measured from the parent's center instead of the origin of the global coordinate system. So if you move a parent object, its children move too, even though the children's coordinates have not changed. The orientation and scaling of a child's local coordinate system are likewise measured relative to those of its parent. If you rotate the parent, the child will rotate (and perhaps revolve) around the same axis.
Parent-child relationships between objects make it simpler to perform (and animate) rotations, scaling and moving in arbitrary directions. In Fig. 1b the teacup is a child object of the coordinate cross on the right. That cross is itself the child of an invisible parent. (It is both a parent and child.) In the cup's local coordinate system, it is not rotating, but as the cross on the right rotates around its Z axis, it causes the cup to rotate and revolve. In real animations, it will be much easier when the character holding the cup rotates, the cup changes its position respectively.
View coordinates[edit | edit source]
Taking the viewer of the scene into consideration, there is another coordinate space: the view coordinates. In Fig. 2 the viewer is symbolized by the camera. The Z axis of the view coordinates always points directly to the viewer in orthographic projection. The X axis points to the right, the Y axis points upwards (Fig. 3).
In fact you always work in view coordinates if you don't set it any other way*. This is particularly useful if you have aligned your view prior to modeling something, e.g. if an object has a slanted roof and you want to create a window to fit in that roof, it would be very complicated to build the window aligned to the local coordinate system of the object, but if you first align your view to the slanted roof, you can easily work in that view coordinate system.
(* In the Blender 2.6 series, the default has been changed to global coordinates. View coordinates remain as an option.)
If you work in one of the three standard views (Front/Top/Side) the alignment of the view coordinates fits the global coordinates. Therefore, it is quite natural to model in one of the standard views and many people find this the best way to model.
Normal coordinates[edit | edit source]
Although Blender is a 3D program, only objects' faces are visible. The orientation of the faces is important for many reasons. For example, in our daily lives it seems quite obvious that a book lies flat on a table. This requires the surface of the table and that of the book to be parallel to each other. If we put a book on a table in a 3D program, there is no mechanism that forces these surfaces to be parallel. The artist needs to ensure that.
The orientation of a face can be described with the help of the so-called surface normal. It is always perpendicular to the surface. If several faces are selected, the resulting normal is averaged from the normals of every single face. In Fig. 4 the normal coordinates of the visible faces are drawn.
This concept can be applied to individual points on the object, even if the points themselves have no orientation. The normal of a point is the average of normals of the adjacent faces.
UV Coordinates[edit | edit source]
In later parts (for example, talking about textures) you will come across coordinates labelled “U” and “V”. These are simply different letters chosen to avoid confusion over “X”, “Y” and “Z”. For example, a raster image is normally laid out on a flat, two-dimensional plane. Each point on the image can be identified by X and Y coordinates. But Blender can take this image and wrap it around the surface of a 3D object as a texture. Points on/in the object have X, Y and Z coordinates. So to avoid confusion, the points on the image are identified using U and V to label their coordinates instead of X and Y. We then refer to “UV mapping” as the process of determining where each (U, V) image point ends up on the (X, Y, Z) object.