# BEZIER_SURFACE Two Files Defining a Bezier Surface

BEZIER_SURFACE is a data directory which contains examples of Bezier surfaces.

A Bezier surface can be thought of as a surface constructed of patches (in the same way that a quilt is made). Each patch, in turn, is defined as the image of a Bezier function (x(u,v), y(u,v), z(u,v)) defined over the unit rectangle in the (u,v) parameter space.

The information defining the Bezier surface can be stored in two simple files:

• the node file lists a set of (x,y,z) values, some of which are points on the surface, and some of which are used to define the slopes;
• the rectangle file lists, for each (u,v) rectangle, the 16 nodes needed to construct the corresponding patch of the surface.

The nodes may be listed in any order. When defining a rectangle, the nodes are indexed by their order in the node file. The 16 nodes to be associated with the rectangle are listed in an order that suggests positions in a unit rectangle, suggested by the following diagram:

```         A
|
|  13--14--15--16
|   |   |   |   |
|   9--10--11--12
|   |   |   |   |
|   5---6---7---8
V |   |   |   |   |
|   1---2---3---4
|
+----------------->
U
```

Note that the node data associated with parameter points on the corners of the (u,v) rectangle corresponds to physical points on the corresponding (x,y,z) surface; however, the node data associated with non-corner parameter points are NOT points on the surface. In particular, only the (x,y,z) data associated with nodes 1, 4, 13, and 16 of the (u,v) rectangle contain coordinates of points on the surface.

Another way to look at the (u,v) parameter space is to double index the points:

```         A
|
|  3,0 3,1 3,2 3,3
|
|  2,0 2,1 2,2 2,3
|
|  1,0 1,1 1,2 1,3
V |
|  0,0 0,1 0,2 0,3
|
+----------------->
U
```

### Related Data and Programs:

BEZIER_SURFACE, a FORTRAN90 library which reads, writes, prints and manipulates data that defines a Bezier surface;

BEZIER_SURFACE_DISPLAY, a MATLAB program which can read the information defining a Bezier surface and display an image of it.

TRIANGULATION_ORDER3, a data directory which describes the related idea of a linear triangulation in which each triangle is defined by 3 nodes.

TRIANGULATION_ORDER6, a data directory which describes the related idea of a quadratic triangulation in which each triangle is defined by 6 nodes.

### Reference:

1. Edward Angel,
Interactive Computer Graphics, a Top-Down Approach with OpenGL,
ISBN: 0-201-38597-X,
LC: T385.A514.
2. The Wikipedia article "Utah teapot" in http://en.wikipedia.org/wiki/Utah_teapot

### Sample Files:

The TEACUP is a simple model of a teacup.

The TEAPOT or UTAH TEAPOT or NEWELL TEAPOT is a standard reference object for computer graphics.

The TEASPOON is a simple model of a teaspoon.

You can go up one level to the DATA page.

Last revised on 19 June 2006