}
@Override
protected void _assembleVertexControlPoints_(DrawContext dc)
{
Terrain terrain = dc.getTerrain();
Path pol = (Path) super._pol_;
Position refPos = pol.getReferencePosition();
Vec4 refPoint = terrain.getSurfacePoint(refPos.getLatitude(), refPos.getLongitude(), 0);
int altitudeMode = pol.getAltitudeMode();
double height = 1000; // pol.getHeight();
Vec4 vaa = null;
double vaaLength = 0; // used to compute independent length of each cap vertex
double vaLength = 0;
int i = 0;
for (LatLon location : pol.getPositions())
{
Vec4 vert;
// Compute the top/cap point.
if (altitudeMode == WorldWind.CONSTANT || !(location instanceof Position))
{
if (vaa == null)
{
// Compute the vector lengths of the top and bottom points at the reference position.
vaa = refPoint.multiply3(height / refPoint.getLength3());
vaaLength = vaa.getLength3();
vaLength = refPoint.getLength3();
}
// Compute the bottom point, which is on the terrain.
vert = terrain.getSurfacePoint(location.getLatitude(), location.getLongitude(), 0);
double delta = vaLength - vert.dot3(refPoint) / vaLength;
vert = vert.add3(vaa.multiply3(1d + delta / vaaLength));
}
else if (altitudeMode == WorldWind.RELATIVE_TO_GROUND)
{
vert = terrain.getSurfacePoint(location.getLatitude(), location.getLongitude(),
((Position) location).getAltitude());
}
else // WorldWind.ABSOLUTE
{
vert = terrain.getGlobe().computePointFromPosition(location.getLatitude(), location.getLongitude(),
((Position) location).getAltitude() * terrain.getVerticalExaggeration());
}
Position vertexPosition = super._wwd.getModel().getGlobe().computePositionFromPoint(vert);
GfrMrkMoveHoriz pnt = new GfrMrkMoveHoriz(vertexPosition, vert,