summaryrefslogtreecommitdiffstats
path: root/util/meshcvt/README
blob: 71679eff1fc31f78ce57a7376427fd62be160bc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
This program converts an object defined as a set of Bezier patches
into vertex array data that can be used to draw it.  A Bezier patch
is a curved surface defined in terms of 16 control points.
The object is decomposed into triangles for rendering.

The primary use for this program is to convert the patch data from
http://www.sjbaker.org/teapot/teaset.tgz for the classic 3D teapot,
but it should work on other objects defined as Bezier patches
or triangle meshes.

The usage for this utility is:

    meshcvt mesh-filename name [depth]

The data to represent the object will be written to standard output.
The "depth" parameter indicates the recursive depth for sub-dividing
Bezier patches into triangles.  The default value is 4.

The input file format starts with the number of patches.
The following lines contain 16 indices to define a patch.
The indices should be comma-separated.

Following the index groups is the number of vertices, and then that
many vertex definitions.  Each vertex definition consists of three
floating-point values, comma-separated.  Three more comma-separated
floating-point values can appear on the line after the vertex
co-ordinates to define a vertex normal.

The teapot.txt file provides the data for the classic 3D teapot
from the above URL as an example of what a Bezier patch definition
file looks like.  The above URL also has Bezier patch data for a
teacup and a teaspoon, to complete your tea service.