protected void tessCombine(RenderContext rc, double[] coords, Object[] data, float[] weight, Object[] outData) { int vertex = this.addVertex(rc, coords[1] /*lat*/, coords[0] /*lon*/, coords[2] /*alt*/, VERTEX_COMBINED /*type*/); outData[0] = vertex; }
Polygon polygon = new Polygon(); polygon.setAltitudeMode(WorldWind.CLAMP_TO_GROUND); polygon.setPathType(WorldWind.LINEAR); polygon.setFollowTerrain(true); // essential for preventing long segments from intercepting ellipsoid. polygon.setDisplayName(fields[1]); polygon.setAttributes(new ShapeAttributes(commonAttrs)); polygon.getAttributes().setInteriorColor(new Color(random.nextFloat(), random.nextFloat(), random.nextFloat(), 0.3f)); polygon.setHighlightAttributes(highlightAttrs); positions.add(Position.fromDegrees(Double.parseDouble(xy[1]), Double.parseDouble(xy[0]), 0)); polygon.addBoundary(positions);
Position.fromDegrees(40, -125, 5.0e5) ); Polygon poly = new Polygon(positions); layer.addRenderable(poly); Position.fromDegrees(40, -95, 0) ); poly = new Polygon(positions); poly.setAltitudeMode(WorldWind.CLAMP_TO_GROUND); // clamp the polygon vertices to the ground poly.setFollowTerrain(true); // follow the ground between polygon vertices layer.addRenderable(poly); Position.fromDegrees(20, -125, 5.0e5) ); poly = new Polygon(positions); poly.setExtrude(true); // extrude the polygon from the ground to each polygon position's altitude layer.addRenderable(poly); attrs.setInteriorColor(new Color(1, 1, 1, 0.5f)); // 50% transparent white attrs.setOutlineWidth(3); poly = new Polygon(positions, attrs); poly.setExtrude(true); // extrude the polygon from the ground to each polygon position's altitude layer.addRenderable(poly); poly = new Polygon(); poly.addBoundary(Arrays.asList( Position.fromDegrees(0, -135, 5.0e5), Position.fromDegrees(5, -140, 7.0e5),
if (this.mustAssembleGeometry(rc)) { this.assembleGeometry(rc); this.vertexBufferKey = nextCacheKey(); this.elementBufferKey = nextCacheKey(); drawable = DrawableSurfaceShape.obtain(pool); drawState = ((DrawableSurfaceShape) drawable).drawState; this.cameraDistance = this.cameraDistanceGeographic(rc, this.boundingSector); ((DrawableSurfaceShape) drawable).sector.set(this.boundingSector); } else { drawable = DrawableShape.obtain(pool); drawState = ((DrawableShape) drawable).drawState; this.cameraDistance = this.cameraDistanceCartesian(rc, this.vertexArray.array(), this.vertexArray.size(), VERTEX_STRIDE, this.vertexOrigin); this.drawInterior(rc, drawState); this.drawOutline(rc, drawState); } else { this.drawOutline(rc, drawState); this.drawInterior(rc, drawState);
Position.fromDegrees(25.0, -55.0, 0.0) ); Polygon polygon = new Polygon(positions); sa = new ShapeAttributes(thickenLine); sa.setInteriorImageSource(ImageSource.fromResource(R.drawable.pattern_sample_houndstooth)); sa.setOutlineImageSource(ImageSource.fromLineStipple(8, (short) 0xDFF6)); polygon.setAttributes(sa); polygon.setAltitudeMode(WorldWind.CLAMP_TO_GROUND); polygon.setFollowTerrain(true); layer.addRenderable(polygon);
this.determineModelToTexCoord(rc); this.addVertex(rc, begin.latitude, begin.longitude, begin.altitude, VERTEX_ORIGINAL /*type*/); this.addIntermediateVertices(rc, begin, end); this.addVertex(rc, end.latitude, end.longitude, end.altitude, VERTEX_ORIGINAL /*type*/); begin = end; this.addIntermediateVertices(rc, begin, positions.get(0));
this.addVertex(rc, loc.latitude, loc.longitude, alt, VERTEX_INTERMEDIATE /*type*/); dist += deltaDist; alt += deltaAlt;