HAIR Model Files

This page includes some hair models I prepared a long time ago. These have been used in numerous paper by various authors, among other places.



You can download the woman head model that fits the hair models above here, courtesy of Murat Afshar. Note that this head model may not fit the models below.



Terms of Use

You may freely download and use the hair model files provided above for your personal or research projects. If you include any material (such as images, videos, or any other visual or numerical data) that you produce using these files in any public document (such as a web page, publication, technical report, a software release or documentation, or any other public document), you are expected to indicate where these models are obtained by placing a link to this web page:
www.cemyuksel.com/research/hairmodels
Any acknowledgements in your public documents are also highly appreciated.

C++ Implementation

cyCodeBase has a code release, cyHairFile, which includes a C++ class implementation that loads and saves hair model files in HAIR file format. Please refer to Using HAIR Files for an example code using this code release.

HAIR File Format Specification

This is a binary file format for 3D hair models. The 3D hair model consists of strands, each one of which is represented by a number of line segments. A HAIR file begins with a 128-Byte long header followed by the following arrays (in presented order) that keep the geometry and topology data:

  • Segments array (unsigned short)
    This array keeps the number of segments of each hair strand. Each entry is a 16-bit unsigned integer, therefore each hair strand can have up to 65,536 segments.

  • Points array (float)
    This array keeps the 3D positions each of hair strand point. These points are not shared by different hair strands; each point belongs to a particular hair strand only. Line segments of a hair strand connects consecutive points. The points in this array are ordered by strand and from root to tip; such that it begins with the root point of the first hair strand, continues with the next point of the first hair strand until the tip of the first hair strand, and then comes the points of the next hair strands. Each entry is a 32-bit floating point number, and each point is defined by 3 consecutive numbers that correspond to x, y, and z coordinates.

  • Thickness array (float)
    This array keeps the thickness of hair strands at point locations, therefore the size of this array is equal to the number of points. Each entry is a 32-bit floating point number.

  • Transparency array (float)
    This array keeps the transparency of hair strands at point locations, therefore the size of this array is equal to the number of points. Each entry is a 32-bit floating point number.

  • Color array (float)
    This array keeps the color of hair strands at point locations, therefore the size of this array is three times the number of points. Each entry is a 32-bit floating point number, and each color is defined by 3 consecutive numbers that correspond to red, green, and blue components.

A HAIR file must have a points array, but all the other arrays are optional. When an array does not exist, corresponding default value from the file header is used instead of the missing array.


HAIR File Header (128 Bytes)

Bytes 0-3 Must be "HAIR" in ascii code (48 41 49 52)
Bytes 4-7 Number of hair strands as unsigned int
Bytes 8-11 Total number of points of all strands as unsigned int
Bytes 12-15 Bit array of data in the file
Bit-0 is 1 if the file has segments array.
Bit-1 is 1 if the file has points array (this bit must be 1).
Bit-2 is 1 if the file has thickness array.
Bit-3 is 1 if the file has transparency array.
Bit-4 is 1 if the file has color array.
Bit-5 to Bit-31 are reserved for future extension (must be 0).
Bytes 16-19 Default number of segments of hair strands as unsigned int
If the file does not have a segments array, this default value is used.
Bytes 20-23 Default thickness hair strands as float
If the file does not have a thickness array, this default value is used.
Bytes 24-27 Default transparency hair strands as float
If the file does not have a transparency array, this default value is used.
Bytes 28-39 Default color hair strands as float array of size 3
If the file does not have a thickness array, this default value is used.
Bytes 40-127 File information as char array of size 88 in ascii