Skip to content

Commit

Permalink
Merge pull request #99 from AnalyticalGraphicsInc/nonconvex
Browse files Browse the repository at this point in the history
Nonconvex
  • Loading branch information
pjcozzi committed Apr 25, 2014
2 parents ad5c218 + d589e63 commit e6b21c1
Show file tree
Hide file tree
Showing 9 changed files with 1,156 additions and 137 deletions.
1 change: 1 addition & 0 deletions AGICHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Beta Releases

### b28 - 2014-05-01

* Added support for non-convex `CustomSensorVolume` visualization.
* Added `FanGeometry`, `FanOutlineGeometry`, and `DynamicFan`. A Fan is defined by an origin and list of directions. This is useful for drawing static projected shapes such as azimuth elevation masks and body masks.

### b27 - 2014-04-01
Expand Down
59 changes: 58 additions & 1 deletion Apps/Sandcastle/gallery/Sensors.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
require([
'Cesium', 'dijit/form/DropDownButton', 'dijit/DropDownMenu', 'dijit/MenuItem', 'dijit/form/HorizontalSlider', 'dijit/TitlePane'
], function(
Cesium, DropDownButton, DropDownMenu, MenuItem, HorizontalSlider, TitlePane)
Cesium, DropDownButton, DropDownMenu, MenuItem, HorizontalSlider, TitlePane)
{
"use strict";

Expand Down Expand Up @@ -137,6 +137,52 @@
return customSensor;
}

function addFootprint(ellipsoid) {
var foot = new Cesium.CustomSensorVolume();

var directions = [];
directions.push({ clock : Cesium.Math.toRadians(0.0), cone : Cesium.Math.toRadians(14.03624347)});
directions.push({ clock : Cesium.Math.toRadians(74.3), cone : Cesium.Math.toRadians(32.98357092)});
directions.push({ clock : Cesium.Math.toRadians(80.54), cone : Cesium.Math.toRadians(37.23483398)});
directions.push({ clock : Cesium.Math.toRadians(90.0), cone : Cesium.Math.toRadians(37.77568431)});
directions.push({ clock : Cesium.Math.toRadians(101.31), cone : Cesium.Math.toRadians(37.41598862)});
directions.push({ clock : Cesium.Math.toRadians(116.56), cone : Cesium.Math.toRadians(29.20519037)});
directions.push({ clock : Cesium.Math.toRadians(180.0), cone : Cesium.Math.toRadians(14.03624347)});
directions.push({ clock : Cesium.Math.toRadians(247.2), cone : Cesium.Math.toRadians(34.11764003)});
directions.push({ clock : Cesium.Math.toRadians(251.56), cone : Cesium.Math.toRadians(44.67589157)});
directions.push({ clock : Cesium.Math.toRadians(253.96), cone : Cesium.Math.toRadians(46.12330271)});
directions.push({ clock : Cesium.Math.toRadians(259.63), cone : Cesium.Math.toRadians(46.19202903)});
directions.push({ clock : Cesium.Math.toRadians(262.87), cone : Cesium.Math.toRadians(45.21405547)});
directions.push({ clock : Cesium.Math.toRadians(262.4), cone : Cesium.Math.toRadians(37.09839406)});
directions.push({ clock : Cesium.Math.toRadians(266.47), cone : Cesium.Math.toRadians(45.42651157)});
directions.push({ clock : Cesium.Math.toRadians(270.0), cone : Cesium.Math.toRadians(45.42651157)});
directions.push({ clock : Cesium.Math.toRadians(270.97), cone : Cesium.Math.toRadians(36.40877457)});
directions.push({ clock : Cesium.Math.toRadians(272.79), cone : Cesium.Math.toRadians(45.70731937)});
directions.push({ clock : Cesium.Math.toRadians(278.33), cone : Cesium.Math.toRadians(45.98533395)});
directions.push({ clock : Cesium.Math.toRadians(281.89), cone : Cesium.Math.toRadians(36.0358894)});
directions.push({ clock : Cesium.Math.toRadians(282.99), cone : Cesium.Math.toRadians(45.0)});
directions.push({ clock : Cesium.Math.toRadians(286.99), cone : Cesium.Math.toRadians(43.26652934)});
directions.push({ clock : Cesium.Math.toRadians(291.8), cone : Cesium.Math.toRadians(33.97011942)});
directions.push({ clock : Cesium.Math.toRadians(293.3), cone : Cesium.Math.toRadians(41.50882857)});
directions.push({ clock : Cesium.Math.toRadians(300.96), cone : Cesium.Math.toRadians(36.0826946)});
directions.push({ clock : Cesium.Math.toRadians(319.18), cone : Cesium.Math.toRadians(19.9888568)});

foot.modelMatrix = getModelMatrix(ellipsoid);
foot.radius = 10000000.0;
foot.setDirections(directions);
foot.portionToDisplay = portion;

foot.material = Cesium.Material.fromType('Color');
foot.material.uniforms.color = new Cesium.Color(0.0, 1.0, 1.0, 0.5);

foot.ellipsoidHorizonSurfaceMaterial = Cesium.Material.fromType('Color');
foot.ellipsoidHorizonSurfaceMaterial.uniforms.color = new Cesium.Color(1.0, 0.0, 1.0, 0.5);

foot.domeSurfaceMaterial = Cesium.Material.fromType('Color');
foot.domeSurfaceMaterial.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 0.5);
return foot;
}

function createUserInterface(viewer) {
var tp = new TitlePane({
title: 'Manipulate Sensor',
Expand All @@ -162,6 +208,9 @@
case 'Custom':
sensor = addCustomSensor(ellipsoid);
break;
case 'Foot':
sensor = addFootprint(ellipsoid);
break;
case 'Rectangular':
sensor = addRectangularSensor(ellipsoid);
}
Expand Down Expand Up @@ -192,6 +241,14 @@
}
}));

sensorMenu.addChild(new MenuItem({
label: 'Foot',
onClick: function() {
selection = 'Foot';
updateSensor();
}
}));

new DropDownButton({
label : 'Select a sensor',
dropDown: sensorMenu
Expand Down
Loading

0 comments on commit e6b21c1

Please sign in to comment.