Next: , Previous: File names, Up: Conventions

4.1.3 Vertices

Several objects share a common style of representing vertices with optional per-vertex surface-normal and color. All vertices within an object have the same format, specified by the header key word.

All data for a vertex is grouped together (as opposed to e.g. giving coordinates for all vertices, then colors for all vertices, and so on).

The syntax is

`x y z'
(3-D floating-point vertex coordinates) or
`x y z w'
(4-D floating-point vertex coordinates)

optionally followed by

`nx ny nz'
(normalized 3-D surface-normal if present)

optionally followed by

`r g b a'
(4-component floating-point color if present, each component in range 0..1. The a (alpha) component represents opacity: 0 transparent, 1 opaque.)

optionally followed by

`s t'
`s t u'

(two or three texture-coordinate values).

Values are separated by white space, and line breaks are immaterial.

Letters in the object's header key word must appear in a specific order; that's the reverse of the order in which the data is given for each vertex. So a `CN4OFF' object's vertices contain first the 4-component space position, then the 3-component normal, finally the 4-component color. You can't change the data order by changing the header key word; an `NCOFF' is just not recognized.