Skip to content

Commit

Permalink
Merge branch 'master' into gltf-update-pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ggetz committed Sep 5, 2018
2 parents 71ff4c4 + 1f33088 commit 0d8a577
Show file tree
Hide file tree
Showing 180 changed files with 4,648 additions and 2,931 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_js:
sudo: false
addons:
chrome: stable
firefox: latest
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
Expand All @@ -19,7 +20,7 @@ script:

- echo 'test webgl-stub' && echo -en 'travis_fold:start:script.test\\r'
- npm run build
- npm run test -- --browsers ChromeCI --webgl-stub --failTaskOnError --suppressPassed
- npm run test -- --browsers FirefoxHeadless --webgl-stub --failTaskOnError --suppressPassed
- echo -en 'travis_fold:end:script.test\\r'

- echo 'makeZipFile' && echo -en 'travis_fold:start:script.makeZipFile\\r'
Expand Down
Binary file modified Apps/SampleData/Cesium3DTiles/Tilesets/Tileset/ll.b3dm
Binary file not shown.
Binary file modified Apps/SampleData/Cesium3DTiles/Tilesets/Tileset/lr.b3dm
Binary file not shown.
Binary file modified Apps/SampleData/Cesium3DTiles/Tilesets/Tileset/parent.b3dm
Binary file not shown.
6 changes: 6 additions & 0 deletions Apps/SampleData/Cesium3DTiles/Tilesets/Tileset/tileset.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "1.0",
"tilesetVersion": "1.2.3"
},
"extras": {
"name": "Sample Tileset"
},
"properties": {
"id": {
"minimum": 0,
Expand Down Expand Up @@ -79,6 +82,9 @@
"geometricError": 0,
"content": {
"uri": "lr.b3dm"
},
"extras": {
"id": "Special Tile"
}
},
{
Expand Down
Binary file modified Apps/SampleData/Cesium3DTiles/Tilesets/Tileset/ul.b3dm
Binary file not shown.
Binary file modified Apps/SampleData/Cesium3DTiles/Tilesets/Tileset/ur.b3dm
Binary file not shown.
59 changes: 24 additions & 35 deletions Apps/Sandcastle/gallery/3D Tiles Clipping Planes.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> <!-- Use Chrome Frame in IE -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="description" content="User-defined clipping planes applied to a batched 3D Tileset, point cloud, and model.">
<meta name="cesium-sandcastle-labels" content="Showcases, 3D Tiles">
<title>Cesium Demo</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script>
<script type="text/javascript">
require.config({
baseUrl : '../../../Source',
waitSeconds : 60
});
if(typeof require === 'function') {
require.config({
baseUrl : '../../../Source',
waitSeconds : 120
});
}
</script>
</head>
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
Expand Down Expand Up @@ -45,7 +47,6 @@
function startup(Cesium) {
'use strict';
//Sandcastle_Begin

// Add a clipping plane, a plane geometry to show the representation of the
// plane, and control the magnitude of the plane distance with the mouse.

Expand All @@ -66,6 +67,7 @@
var targetY = 0.0;
var planeEntities = [];
var selectedPlane;
var clippingPlanes;

// Select plane when mouse down
var downHandler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
Expand Down Expand Up @@ -112,16 +114,16 @@

var tileset;
function loadTileset(url) {
var clippingPlanes = [
new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 0.0, -1.0), -100.0)
];
clippingPlanes = new Cesium.ClippingPlaneCollection({
planes : [
new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 0.0, -1.0), -100.0)
],
edgeWidth : viewModel.edgeStylingEnabled ? 1.0 : 0.0
});

tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url : url,
clippingPlanes : new Cesium.ClippingPlaneCollection({
planes : clippingPlanes,
edgeWidth : viewModel.edgeStylingEnabled ? 1.0 : 0.0
})
clippingPlanes : clippingPlanes
}));

tileset.debugShowBoundingVolume = viewModel.debugBoundingVolumesEnabled;
Expand All @@ -132,7 +134,7 @@
viewer.zoomTo(tileset, new Cesium.HeadingPitchRange(0.5, -0.2, radius * 4.0));

for (var i = 0; i < clippingPlanes.length; ++i) {
var plane = clippingPlanes[i];
var plane = clippingPlanes.get(i);
var planeEntity = viewer.entities.add({
position : boundingSphere.center,
plane : {
Expand All @@ -152,21 +154,14 @@
});
}

var modelEntityClippingPlanes;
function loadModel(url) {
var clippingPlanes = [
new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 0.0, -1.0), -100.0)
];

modelEntityClippingPlanes = new Cesium.ClippingPlaneCollection({
planes : clippingPlanes,
clippingPlanes = new Cesium.ClippingPlaneCollection({
planes : [
new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 0.0, -1.0), -100.0)
],
edgeWidth : viewModel.edgeStylingEnabled ? 1.0 : 0.0
});

function updateClippingPlanes() {
return modelEntityClippingPlanes;
}

var position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 100.0);
var heading = Cesium.Math.toRadians(135.0);
var pitch = 0.0;
Expand All @@ -181,14 +176,14 @@
uri : url,
scale : 8,
minimumPixelSize : 100.0,
clippingPlanes : new Cesium.CallbackProperty(updateClippingPlanes, false)
clippingPlanes : clippingPlanes
}
});

viewer.trackedEntity = entity;

for (var i = 0; i < clippingPlanes.length; ++i) {
var plane = clippingPlanes[i];
var plane = clippingPlanes.get(i);
var planeEntity = viewer.entities.add({
position : position,
plane : {
Expand Down Expand Up @@ -244,13 +239,7 @@
Cesium.knockout.getObservable(viewModel, 'edgeStylingEnabled').subscribe(function(value) {
var edgeWidth = value ? 1.0 : 0.0;

if (Cesium.defined(tileset)) {
tileset.clippingPlanes.edgeWidth = edgeWidth;
}

if (Cesium.defined(modelEntityClippingPlanes)) {
modelEntityClippingPlanes.edgeWidth = edgeWidth;
}
clippingPlanes.edgeWidth = edgeWidth;
});

function reset() {
Expand All @@ -262,7 +251,7 @@
}

//Sandcastle_End
Sandcastle.finishedLoading();
Sandcastle.finishedLoading();
}
if (typeof Cesium !== 'undefined') {
startup(Cesium);
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/3D Tiles Feature Styling.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
'use strict';
//Sandcastle_Begin
// A demo of interactive 3D Tiles styling
// Styling language Documentation: https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/Styling
// Styling language Documentation: https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling
// Building data courtesy of NYC OpenData portal: http://www1.nyc.gov/site/doitt/initiatives/3d-building.page
var viewer = new Cesium.Viewer('cesiumContainer', {
terrainProvider: Cesium.createWorldTerrain()
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/3D Tiles Interactivity.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
}

// Evaluate feature description
console.log('Description : ' + tileset.style.meta.description.evaluate(scene.frameState, feature));
console.log('Description : ' + tileset.style.meta.description.evaluate(feature));
}

function zoom(movement, feature) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

// A normal b3dm tileset of photogrammetry
var tileset = new Cesium.Cesium3DTileset({
url: Cesium.IonResource.fromAssetId(5712)
url: Cesium.IonResource.fromAssetId(6074)
});
viewer.scene.primitives.add(tileset);
viewer.zoomTo(tileset);
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/3D Tiles Photogrammetry.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
});

var tileset = new Cesium.Cesium3DTileset({
url: Cesium.IonResource.fromAssetId(5712)
url: Cesium.IonResource.fromAssetId(6074)
});

viewer.scene.primitives.add(tileset);
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/Cardboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
var radians = Cesium.Math.toRadians(i);
var timeIncrement = i - startAngle;
var time = Cesium.JulianDate.addSeconds(start, timeIncrement, new Cesium.JulianDate());
var position = Cesium.Cartesian3.fromDegrees(lon + (radius * 1.5 * Math.cos(radians)), lat + (radius * Math.sin(radians)), Cesium.Math.nextRandomNumber() * 500 + 1750);
var position = Cesium.Cartesian3.fromDegrees(lon + (radius * 1.5 * Math.cos(radians)), lat + (radius * Math.sin(radians)), Cesium.Math.nextRandomNumber() * 500 + 1800);
property.addSample(time, position);
}
return property;
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/Classification Types.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
});
viewer.scene.globe.depthTestAgainstTerrain = false;

var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(5712) });
var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(6074) });
viewer.scene.primitives.add(tileset);

tileset.readyPromise.then(function(){
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/Classification.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
scene.invertClassificationColor.alpha = parseFloat(value);
}

var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(5712) });
var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(6074) });
scene.primitives.add(tileset);

var viewModel = {
Expand Down
84 changes: 73 additions & 11 deletions Apps/Sandcastle/gallery/Geometry Height Reference.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="description" content="An example for how to use the GeometryHeightProperty to height reference a corridor, ellipse, polygon or rectangle.">
<meta name="description" content="An example for how to use the HeightReference property on different geometry entities.">
<meta name="cesium-sandcastle-labels" content="Geometries">
<title>Cesium Demo</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
Expand Down Expand Up @@ -41,6 +41,20 @@
// instead of showing through it from underground
viewer.scene.globe.depthTestAgainstTerrain = true;

Sandcastle.addToolbarMenu([{
text : 'Polygons',
onselect : function() {
viewer.entities.removeAll();
addPolygons();
}
}, {
text : 'Boxes, Cylinders and Ellipsoids',
onselect : function() {
viewer.entities.removeAll();
addGeometries();
}
}]);

Sandcastle.addToolbarMenu([{
text : 'Terrain Enabled',
onselect : function() {
Expand All @@ -53,11 +67,57 @@
}
}]);

var longitude = 6.850615989890521;
var latitude = 45.89546589994886;
var longitude = 6.950615989890521;
var latitude = 45.79546589994886;
var delta = 0.001;

function addEntity(i, j) {
function addGeometry(i, j) {
var west = longitude + delta * i;
var north = latitude + delta * j + delta;

var type = Math.floor(Math.random() * 3);
if (type === 0) {
viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(west, north, 0.0),
box : {
dimensions : new Cesium.Cartesian3(40.0, 30.0, 50.0),
material : Cesium.Color.fromRandom({alpha : 1.0}),
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
}
});
} else if (type === 1) {
viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(west, north, 0.0),
cylinder : {
length :50.0,
topRadius : 20.0,
bottomRadius : 20.0,
material : Cesium.Color.fromRandom({alpha : 1.0}),
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
}
});
} else {
viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(west, north, 0.0),
ellipsoid : {
radii : new Cesium.Cartesian3(20.0, 15.0, 25.0),
material : Cesium.Color.fromRandom({alpha : 1.0}),
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
}
});
}
}

function addGeometries(){
for (var i = 0; i < 4; i++) {
for (var j = 0; j < 4; j++) {
addGeometry(i, j);
}
}
viewer.zoomTo(viewer.entities);
}

function addPolygon(i, j) {
var west = longitude + delta * i;
var east = longitude + delta * i + delta;

Expand All @@ -81,15 +141,17 @@
});
}

// create 16 polygons that are side-by-side
for (var i = 0; i < 4; i++) {
for (var j = 0; j < 4; j++) {
addEntity(i, j);
function addPolygons() {
// create 16 polygons that are side-by-side
for (var i = 0; i < 4; i++) {
for (var j = 0; j < 4; j++) {
addPolygon(i, j);
}
}
viewer.camera.lookAt(Cesium.Cartesian3.fromDegrees(longitude, latitude, 1500), new Cesium.HeadingPitchRange(-Cesium.Math.PI/2, -Cesium.Math.PI_OVER_FOUR, 2000));
viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
}

viewer.camera.lookAt(Cesium.Cartesian3.fromDegrees(longitude, latitude, 500), new Cesium.HeadingPitchRange(Cesium.Math.PI, -Cesium.Math.PI_OVER_FOUR, 2000));
viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);//Sandcastle_End
//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== 'undefined') {
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/Materials.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
type : 'Water',
uniforms : {
specularMap: '../images/earthspec1k.jpg',
normalMap: require.toUrl('Assets/Textures/waterNormals.jpg'),
normalMap: Cesium.buildModuleUrl('Assets/Textures/waterNormals.jpg'),
frequency: 10000.0,
animationSpeed: 0.01,
amplitude: 1.0
Expand Down
Binary file modified Apps/Sandcastle/gallery/Plane.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/Scene Rendering Performance.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ <h4>Max delta time</h4>
function loadTilesetScenario() {
resetScene();

tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(5712) });
tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(6074) });
viewer.scene.primitives.add(tileset);
viewer.zoomTo(tileset);
}
Expand Down
Loading

0 comments on commit 0d8a577

Please sign in to comment.