# Class: FeaturePoint

## FeaturePoint

#### new FeaturePoint()

  Feature point.
  This struct represents a feature point definition. If the feature points are defined on a 3D model, each feature point maps to a vertex of the model. The following information is specified per each feature point: - vertex position (an array of 3 floats) - vertex identifier (mesh identifier and vertex index), if the feature point is defined on a 3D model - normalization factors (useful for algorithms that normalize the face, such as facial motion cloning)
  Note: After the end of use FeaturePoint object needs to be deleted to release the allocated memory. Example:

      <script>
      FeaturePoint = new VisageModule.FeaturePoint();
      ...
      FeaturePoint.delete();
      </script>

  See:
    - FDP

### Members

#### defined :number

  Set with regards to the 3D model used. More information about 3D models used in tracking can be found in VisageTracker Configuration Manual.
  Set to 1 if feature point is defined in the corresponding .fdp file. Otherwise, the feature point should not be used.

  ##### Type:

  - number

#### detected :number

  Set with regards to the tracking algorithm used.
  If 1, indicates that the feature point is obtained from a 2D image using the tracking algorithm. 0 indicates that the feature point is estimated from fitting a 3D model onto the detected feature points of the face.
  NOTE: This information is returned exclusively within FaceData::featurePoints2D.

  ##### Type:

  - number

#### quality :number

  Information about the accuracy of the tracking algorithm for this feature point in the current frame.
  Quality is returned as a value from 0 to 1, where 0 is the worst and 1 is the best quality. If -1 is returned, quality is not estimated.
  This information is returned for all feature points' groups except for group 10 (ears) for which the returned value will always be -1.
  NOTE: This information is returned exclusively within FaceData::featurePoints2D.

  ##### Type:

  - number

#### surf :string

  Identifier of the polygon mesh (surface) to which the vertex corresponding to the feature point belongs. If the feature points are not defined on a 3D model (e.g. if they represent points in a 2D image), this is not used.

  ##### Type:

  - string

#### vert :number

  Identifier of the vertex to which the vertex corresponding to the feature point belongs. This is the vertex index within the polygon mesh (surface) identified by surf. If the feature points are not defined on a 3D model (e.g. if they represent points in a 2D image), this is not used.

  ##### Type:

  - number

### Methods

#### getPos(position) → {number}

  Get one of the feature point positions (x,y,z).
  x, y, z coordinates of the feature point. If the feature point is 2-dimensional (e.g. feature points in an image) the z coordinate is ignored.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `position` | number | specifies desired position to get of the pos array, 0 for x, 1 fox y or 2 for z coordinate.

  ##### Returns:

  Type
    number

#### setPos(position, value)

  Set one of the feature point positions (x,y,z).
  x, y, z coordinates of the feature point. If the feature point is 2-dimensional (e.g. feature points in an image) the z coordinate is ignored.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `position` | number | specifies desired position to set of the pos array, 0 for x, 1 fox y or 2 for z coordinate.
  `value` | number | coordinate value.