Vertex statements give the points, coordinates and directions that the elements use. They make no shape on their own. Each kind is numbered in file order, from 1.
The four statements
| Statement | Holds | Used by |
|---|---|---|
v x y z [w] | A geometric vertex | Faces, lines, points, curves, surfaces |
vt u [v] [w] | A texture vertex | Faces, lines, surfaces |
vn i j k | A vertex normal | Faces, surfaces |
vp u [v] [w] | A parameter space vertex | Trimming curves, special points |
v – Geometric vertex
Three coordinates and an optional weight w. The weight is used by rational
curves and surfaces and is 1.0 by default. The specification recommends a positive
weight.
Some programs write a colour after the coordinates, as
v x y z r g b, with each colour value from 0 to 1. This is not in the
specification, and a colour leaves no room for w.
v -0.5 0.0 1.25
v 1.0 2.0 3.0 1.0
v 0.0 0.0 0.0 0.8 0.2 0.2
vt – Texture vertex
A position in a texture: u, and optionally v and
w, which default to 0. It supports 1D, 2D and 3D textures.
vt 0.25 0.75
vt 0.5 0.5 0.0
vn – Vertex normal
A direction, the three numbers i, j and k. When a
face has normals they replace its smoothing groups. A normal need not be a unit vector.
vn 0.0 0.0 1.0
vp – Parameter space vertex
A point in the parameter space of a curve or surface. The number of values depends on its use:
| Use | Values |
|---|---|
| Special point on a curve | u |
| Special point on a surface | u v |
| Non-rational trimming curve | u v |
| Rational trimming curve | u v w, with w defaulting to 1.0 |
Referring to vertices
Each kind of vertex has its own numbering, from 1, in file order. The numbers carry on through the whole file, even when other statements or elements come between vertices.
An element names a vertex by its number. A negative number counts back from the place
the element appears: -1 is the vertex of that kind defined most recently
above it, -2 the one before that, and so on.
v 0 0 0
v 1 0 0
v 1 1 0
f 1 2 3 # by number
f -3 -2 -1 # the same face, counting back