Descriptions of 3D Objects.

Copyright (c) Susan Laflin. August 1999.

Consider a simple example of an object in three-dimensions, namely the cube shown below:

Object in 3 Dimensions

To store sufficent information to produce this wire-frame drawing of the object, you need to store the coordinates of the vertices and some means of indicating which vertices are connected by straight lines. So one essential requirement is an array containing the coordinates of the vertices and in the example given, the coordinates describe a cube centred on the origin. To obtain any other cube, you need to apply shift, scale and rotation transformations to the vertices before re-drawing the cube in its new position. These transformations will be discussed in the next section.

Array of coordinates [x,y,z] for each vertex.
	Name. Index.	  x      y      z
 	A       1       -1     	+1     	-1
 	B       2       +1     	+1     	-1
 	C       3       +1     	-1     	-1
 	D       4       -1     	-1     	-1
 	E       5       -1     	+1     	+1
 	F       6       +1     	+1     	+1
 	G       7       +1     	-1     	+1
 	H       8       -1     	-1     	+1

The remaining information can be coded in many ways, one of which is as an array of edges. For each vertex, you store the index numbers of the other vertices to which it is joined and in this case when all edges are straight lines, there is no need to store information on the type of curve used to join the vertices.

	Array of edges.
 	From.  To.
  	1     	2    	4   	5
  	2    	*1    	3   	6
  	3    	*2    	4   	7
  	4    	*1   	*3   	8
  	5    	*1    	6   	8
  	6    	*2   	*5   	7
  	7    	*3   	*6   	8
  	8    	*4   	*5  	*7

The first row of this array indicates that vertex 1(A) is joined to vertex 2(B), to vertex 4(D) and to vertex 5(E). The second row indicates that vertex 2(B) is joined to vertex 1(A), which is certainly correct, but wasteful, as it implies that this line is drawn twice. Examination of the array shows that the same is true of all other lines in the diagram. To save time by only drawing it once, you need to draw only those cases where the order of the vertices is increasing, that is you omit all the connections marked with a star when drawing the object.

These two arrays are sufficient to produce a wire-frame drawing such as that shown in the above figure. However if you wish to discuss solid faces, or use any form of shading or texturing, you will need to move to a more complex representation such as that for boundary representation models used in geometric modelling. In this case, the following data structure is appropriate.


1) Vertex.	Set of [x,y,z] coordinates.

2) Edge.    	Start and end vertices. 
		Equation of curve joining them.

3) Loop.     	List of edges making up the loop. 
		Direction in which they are drawn.

4) Face.     	List of loops forming boundary. 
		Equation of surface. 
		Direction of outward normal(s).

5) Shell.    	List of faces making up the shell.

6) Object.   	List of shells making up surface of object. 
		One is identified as the `outer shell'.

When you come to consider the cube, this is a very simple object. All the edges are straight lines and all the faces are planes. If you choose to define the loops as the square outline made up of 4 edges, then each face has one loop as its boundary. Alternatively, you could have two edges to a loop and then each face would require two loops to specify its boundary. When you come to study geometric modelling, you will find that there are often several equally correct solutions to any given problem.


Vertices.	The array of coordinates for the 8 vertices has 
		already been described.

Edges. 		There are 12 edges, all straight lines joining pairs of 
		vertices. They may be traversed in either direction.

Loops. 		You may choose to specify 6 loops, each consisting of 
		4 edges. As an example, the top face may be bounded by 
		the loop consisting of edges [ AE, EF, FB, BA ]. 
		You will again find that each edge is traversed 
		twice, once in each direction, in the complete 
		description of the object.

Faces. 		All solutions will have 6 faces and in one choice of 
		loop, each face will be bounded by one loop. It is usual 
		to adopt a standard convention connecting the direction 
		of circulation of the loops and the directions of 
		the outward-facing normals to the face. In this example, 
		each face will be a plane and will have a single direction 
		for its normal.

Shell. 		This consists of the 6 faces.

Object. 	This is made up of the single shell and the volume contained 
		within it.