A Catmull-Clark polygon mesh (ccmesh) is defined very similar to a regular polygon mesh, however it is further subdivided to get a smooth limit surface.
The polygons in the ccmesh can have an arbitrary number of edges. In the subdivision process each polygon is split into quadrilaterals using generalized Catmull-Clark subdivision rules.
Similar to subdivision surfaces a fractional sharpness value can be assigned to the polygon edges and vertices can be tagged with a corner feature. The sharpness values introduces a local crease on the surface.
There are two main differences between a ccmesh and a subdivision surface. First, a ccmesh cannot define hierarchies, and second, a ccmesh can define polygons with an arbitrary number of edges, not just triangles and quads.
object "object_name" ... # flags, boxes, data, etc. group vector list vertex list ccmesh ... # more surfaces [ approximation list ] end group end object
The vector list in the group is a list of (x, y, z) vectors used for polygon vertex positions, texture and motion vectors.
The vertex list that follows the vector list builds control vertices from the vectors. This works like the vertex list of polygonal geometry, except that normals should not be defined. Here position vectors, texture coordinates and motion vectors can be referenced.
A corner features may be associated with vertices by specifying corner behind the regular vertex definition:
v vec_ref [ tex_list ] [ m motion_ref ] [ corner [ level level ] ]
Here vec_ref is the reference of a position, tex_list is a list of texture coordinates with t keywords and corresponding coordinate indices, and motion_ref is an optional motion vector. Up to 15 motion vectors may be specified for each vertex.
The optional vertex feature follows, and an optional level can be specified if the feature is active on a level above vertex definition level. The corner vertex feature is described in more detail in a separate section below.
The ccmesh geometry list consists of ccmesh statements, much like Free-Form geometry consists of surface statements. For a description of vector lists and vertex lists, refer to page vector.
The approximation statements are very similar to the free-form case, except that approximate surface is replaced by approximate ccmesh. See section approx for details.
A ccmesh specifies a name, size options and a list of polygons, followed by optional derivative request:
ccmesh "surface_name" [ polygon npint vertex nvint ] [ mesh ] [ derivative_request ] end ccmesh
The polygon statement specifies the total number of polygons which are defined in the mesh, the vertex statement specifies the total number of vertices used by the polygons.
The mesh is very similar to polygons, it uses the same syntax.
p [ "material_name" ] vertex_ref_list [ crease sharpness_list ]
The p keyword begins definition of a polygon. An optional material name may follow, otherwise the material of the previous polygon is assigned to the current polygon. If the current object is marked as tagged, a label integer must be given instead of the material name (this is not shown here). Polygon vertices must be specified in the vertex_ref_list.
The optional crease statement allows specification of crease edges. If the crease statement is given, then for each polygon edge a floating point sharpness values follows in the sharpness_list. Any edge not creased in this list must be given with a zero sharpness.
Vertices may be tagged with a corner feature to modify the subdivision rule. At a corner vertex more than two crease or boundary edges are incident, the limit surface has no tangent plane at this location, and the vertex is interpolated. The surface is partitioned into smooth patches separated by the crease lines and converge at the corner vertex.
Creases are discontinuities introduced into the surface in oder to define sharp geometric details such as wrinkles. Crease edges may be specified for edges which are not on the geometric boundary.
A vertex with exactly two incident crease edges is internally marked as a crease vertex. Normal vectors for vertices on an infinite sharp crease line are not shared; instead, two normal vectors are created for the polygons on each of the two sides on the crease line. A crease sharpness value of 0 assigned to an edge will result in smooth subdivision, a value of 1 results will generate an infinite sharp crease, and fractional values between 0 and 1 will generate smooth creases. Sharpness values of subsequent higher subdivision levels are computed using a quadratic B-Spline function applied to the sharpness values of the parent edges.
mental ray can generate surface derivative vectors for ccmesh if requested. They are computed and stored only if requested by derivative_request statements in the ccmesh definition:
derivative numberint [ spaceint ]
For number 1 must be specified, higher derivatives are not supported. Since a ccmesh allow arbitrary topology, there is no intrinsic surface parameterization available, so a texture space which defines orientation of the derivative vectors must always be specified with the space number. The first t vectors in the vertex definition is space 0, the second is space 1, and so on.
In the example below a cylinder with hexagonal caps is created. Infinitely sharp creases are assigned to the cap polygons.
object "hexacylinder" group 2 0 0 1.5 -2 0 -1.5 -2 0 -2 0 0 -1.5 2 0 1.5 2 0 2 0 6 1.5 -2 6 -1.5 -2 6 -2 0 6 -1.5 2 6 1.5 2 6 v 0 v 1 v 2 v 3 v 4 v 5 v 6 v 7 v 8 v 9 v 10 v 11 ccmesh "surf1" polygon 8 vertex 36 p 0 1 2 3 4 5 crease 1 1 1 1 1 1 p 6 11 10 9 8 7 crease 1 1 1 1 1 1 p 2 1 7 8 p 1 0 6 7 p 0 5 11 6 p 5 4 10 11 p 4 3 9 10 p 3 2 8 9 end ccmesh approximate ccmesh parametric 2 "surf1" end group end objectCopyright © 1986, 2013 NVIDIA Corporation