function getPosition(encoding, mode, projection, vertices, index, result) {
  let position = encoding.getExaggeratedPosition(vertices, index, result);

  if (defined(mode) && mode !== SceneMode.SCENE3D) {
    const ellipsoid = projection.ellipsoid;
    const positionCartographic = ellipsoid.cartesianToCartographic(
      position,
      scratchCartographic,
    );
    position = projection.project(positionCartographic, result);
    position = Cartesian3.fromElements(
      position.z,
      position.x,
      position.y,
      result,
    );
  }

  return position;
}
Gets the {@link TerrainMesh} that is used for rendering this tile, if any.
Returns the value of the {@link GlobeSurfaceTile#mesh} property if
{@link GlobeSurfaceTile#vertexArray} is defined. Otherwise, It returns the
{@link TerrainFillMesh#mesh} property of the {@link GlobeSurfaceTile#fill}.
If there is no fill, it returns undefined.

@memberof GlobeSurfaceTile.prototype
@type {TerrainMesh}