Skip to content

Commit

Permalink
Update Ellipse tutorial for 3D ellipses
Browse files Browse the repository at this point in the history
  • Loading branch information
zglueck committed Jan 19, 2018
1 parent 50ece02 commit 08c64b4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
22 changes: 19 additions & 3 deletions worldwind-tutorials/src/main/assets/ellipse_tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ <h1>Ellipse Tutorial</h1>
Demonstrates how to add an Ellipse to a RenderableLayer.
</p>
<p>
This example renders four different ellipses on the globe.
This example renders six different ellipses on the globe.
<ul>
<li>The Northwestern ellipse demonstrates the default styling and configuration.</li>
<li>The Northeastern ellipse uses custom attributes.</li>
<li>The Southwestern ellipse has a 45 degree heading.</li>
<li>The Southeastern ellipse displays a circle.</li>
<li>The Western ellipse has a 45 degree heading.</li>
<li>The Eastern ellipse displays a circle.</li>
<li>The Southwestern ellipse is at an altitude of 200km.</li>
<li>The Southeastern ellipse is at an altitude of 200km, extrude, and custom attributes.</li>
</ul>
</p>
<h2>Example</h2>
Expand Down Expand Up @@ -90,6 +92,20 @@ <h3>EllipseFragment.java</h3>
ellipse.setFollowTerrain(true); // cause the ellipse geometry to follow the terrain surface
tutorialLayer.addRenderable(ellipse);

// Create an ellipse with the default attributes, an altitude of 200 km, and a 500km major-radius and a 300km
// minor-radius.
ellipse = new Ellipse(new Position(25, -120, 200e3), 500000, 300000);
tutorialLayer.addRenderable(ellipse);

// Create an ellipse with custom attributes that make the interior 50% transparent and an extruded outline with
// vertical lines
attrs = new ShapeAttributes();
attrs.setInteriorColor(new Color(1, 1, 1, 0.5f)); // 50% transparent white
attrs.setDrawVerticals(true);
ellipse = new Ellipse(new Position(25, -100, 200e3), 500000, 300000, attrs);
ellipse.setExtrude(true);
tutorialLayer.addRenderable(ellipse);

return wwd;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ public WorldWindow createWorldWindow() {
ellipse.setFollowTerrain(true); // cause the ellipse geometry to follow the terrain surface
tutorialLayer.addRenderable(ellipse);

// Create an ellipse with the default attributes, an altitude of 200 km, and a 500km major-radius and a 300km
// minor-radius.
ellipse = new Ellipse(new Position(25, -120, 200e3), 500000, 300000);
tutorialLayer.addRenderable(ellipse);

// Create an ellipse with custom attributes that make the interior 50% transparent and an extruded outline with
// vertical lines
attrs = new ShapeAttributes();
attrs.setInteriorColor(new Color(1, 1, 1, 0.5f)); // 50% transparent white
attrs.setDrawVerticals(true);
ellipse = new Ellipse(new Position(25, -100, 200e3), 500000, 300000, attrs);
ellipse.setExtrude(true);
tutorialLayer.addRenderable(ellipse);

return wwd;
}
}

0 comments on commit 08c64b4

Please sign in to comment.