Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3D Tiles - Newly generated tilesets #4991

Merged
merged 4 commits into from
Feb 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 10 additions & 18 deletions Apps/Sandcastle/gallery/3D Tiles Point Cloud Styling.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

var styles = [];
function addStyle(name, style) {
style.pointSize = Cesium.defaultValue(style.pointSize, 5.0);
styles.push({
name : name,
style : style
Expand Down Expand Up @@ -120,48 +121,39 @@
});

addStyle('Arc Trigonometric Functions', {
color : "color() * acos(degrees(${temperature})) + color() * asin(${temperature}) + color() * atan(${temperature}) + color() * atan2(${POSITION}[0],${temperature})",
pointSize : "5"
color : "color() * acos(degrees(${temperature})) + color() * asin(${temperature}) + color() * atan(${temperature}) + color() * atan2(${POSITION}[0],${temperature})"
});

addStyle('Sqrt', {
color : "color() * sqrt(${temperature})",
pointSize : "5"
color : "color() * sqrt(${temperature})"
});

addStyle('Sign', {
color : "rgb(sign(${POSITION}[0]) * 255, sign(${POSITION}[1]) * 255, sign(${POSITION}[2]) * 255)",
pointSize : "5"
color : "rgb(sign(${POSITION}[0]) * 255, sign(${POSITION}[1]) * 255, sign(${POSITION}[2]) * 255)"
});

addStyle('Rounding Functions', {
color : "rgb(floor(${POSITION}[0]) * 255, ceil(${POSITION}[1]) * 255, round(${POSITION}[2]) * 255)",
pointSize : "5"
color : "rgb(floor(${POSITION}[0]) * 255, ceil(${POSITION}[1]) * 255, round(${POSITION}[2]) * 255)"
});

addStyle('Exp and Log Functions', {
color : "rgb(log(${POSITION}[0]) * 255, log2(${POSITION}[1]) * 255 + exp2(${POSITION}[1]) * 255, exp(${POSITION}[2]) * 255)",
pointSize : "5"
color : "rgb(log(${POSITION}[0]) * 255, log2(${POSITION}[1]) * 255 + exp2(${POSITION}[1]) * 255, exp(${POSITION}[2]) * 255)"
});

addStyle('Fractional Part', {
color : "rgb(fract(${POSITION}[0]) * 255, fract(${POSITION}[1]) * 255, fract(${POSITION}[2]) * 255)",
pointSize : "5"
color : "rgb(fract(${POSITION}[0]) * 255, fract(${POSITION}[1]) * 255, fract(${POSITION}[2]) * 255)"
});

addStyle('Pow', {
color : "color() * pow(${temperature}, 3)",
pointSize : "5"
color : "color() * pow(${temperature}, 3)"
});

addStyle('Min and Max', {
color : "rgb(min(${POSITION}.x, 0.75) * 255, max(${POSITION}.z, 0.25) * 255, 255)",
pointSize : "5"
color : "rgb(min(${POSITION}.x, 0.75) * 255, max(${POSITION}.z, 0.25) * 255, 255)"
});

addStyle('Clamp and Mix', {
color : "color() * clamp(${temperature}, 0.1, 0.2)",
pointSize : "mix(${temperature}, 2.0, 0.5) * 0.2"
color : "color() * clamp(${temperature}, 0.1, 0.2)"
});

addStyle('Secondary Color', {
Expand Down
8 changes: 5 additions & 3 deletions Apps/Sandcastle/gallery/3D Tiles.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
url: '../../../Specs/Data/Cesium3DTiles/Instanced/InstancedWithBatchTable/'
}, {
name: 'Instanced/Orientation',
url: '../../../Specs/Data/Cesium3DTiles/Instanced/InstancedOrientationWithBatchTable/'
url: '../../../Specs/Data/Cesium3DTiles/Instanced/InstancedOrientation/'
}, {
name: 'Composite',
url: '../../../Specs/Data/Cesium3DTiles/Composite/Composite/'
Expand Down Expand Up @@ -170,8 +170,10 @@
}

// evaluate feature description
if (Cesium.defined(tileset.style.meta.description)) {
console.log("Description : " + tileset.style.meta.description.evaluate(scene.frameState, feature));
if (Cesium.defined(tileset.style)) {
if (Cesium.defined(tileset.style.meta.description)) {
console.log('Description : ' + tileset.style.meta.description.evaluate(scene.frameState, feature));
}
}
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
Expand Down
1 change: 1 addition & 0 deletions Source/Scene/Cesium3DTileBatchTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ define([
* @private
*/
this.batchTableJson = batchTableJson;

/**
* @private
*/
Expand Down
4 changes: 3 additions & 1 deletion Source/Scene/PointCloud3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,9 @@ define([
colorStyleFunction = style.getColorShaderFunction('getColorFromStyle', 'czm_tiles3d_style_', shaderState);
showStyleFunction = style.getShowShaderFunction('getShowFromStyle', 'czm_tiles3d_style_', shaderState);
pointSizeStyleFunction = style.getPointSizeShaderFunction('getPointSizeFromStyle', 'czm_tiles3d_style_', shaderState);
styleTranslucent = shaderState.translucent;
if (defined(colorStyleFunction) && shaderState.translucent) {
styleTranslucent = true;
}
}

content._styleTranslucent = styleTranslucent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ define([
if (defined(current) && defined(current._batchTable) && !current._batchTable.isDestroyed()) {
// Restore original color to feature that is no longer selected
var frameState = that._scene.frameState;
if (!that._colorOverriden) {
if (!that._colorOverriden && defined(that._style)) {
current.color = that._style.color.evaluateColor(frameState, current, scratchColor);
} else {
current.color = oldColor;
Expand Down Expand Up @@ -586,7 +586,7 @@ define([

// set feature again so pick coloring is set
var temp = this._feature;
this._feature = undefined;
this._feature = undefined;
this._feature = temp;
}
}
Expand Down
Binary file not shown.
12 changes: 6 additions & 6 deletions Specs/Data/Cesium3DTiles/Batched/BatchedColors/tileset.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
"maximum": 9
},
"Longitude": {
"minimum": -1.3196957429116396,
"maximum": -1.3196641554181918
"minimum": -1.3196972173766555,
"maximum": -1.3196683129064435
},
"Latitude": {
"minimum": 0.6988601375872411,
"maximum": 0.6988869857121214
"minimum": 0.698861998722264,
"maximum": 0.6988888301460953
},
"Height": {
"minimum": 6,
"maximum": 14
"minimum": 6.929546581581235,
"maximum": 13.581844886764884
}
},
"geometricError": 70,
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,16 @@
"maximum": 9
},
"Longitude": {
"minimum": -1.3196930452470341,
"maximum": -1.3196617964314208
"minimum": -1.3196972173766555,
"maximum": -1.3196683129064435
},
"Latitude": {
"minimum": 0.6988594477444204,
"maximum": 0.698883763781271
"minimum": 0.698861998722264,
"maximum": 0.6988888301460953
},
"Height": {
"minimum": 6,
"maximum": 14
},
"info": {
"minimum": null,
"maximum": null
},
"rooms": {
"minimum": null,
"maximum": null
"minimum": 6.929546581581235,
"maximum": 13.581844886764884
}
},
"geometricError": 70,
Expand All @@ -43,7 +35,7 @@
},
"geometricError": 0,
"content": {
"url": "batchedNoBuildings.b3dm"
"url": "batchedColorsMix.b3dm"
}
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@
"properties": {
"id": {
"minimum": 0,
"maximum": 99
"maximum": 9
},
"Longitude": {
"minimum": -1.3197004048940548,
"maximum": -1.3196602716044172
"minimum": -1.3196972173766555,
"maximum": -1.3196683129064435
},
"Latitude": {
"minimum": 0.6988585409308616,
"maximum": 0.6988894207110236
"minimum": 0.698861998722264,
"maximum": 0.6988888301460953
},
"Height": {
"minimum": 0,
"maximum": 80
"minimum": 6.929546581581235,
"maximum": 13.581844886764884
}
},
"geometricError": 40,
"refine": "add",
"geometricError": 70,
"root": {
"refine": "add",
"boundingVolume": {
"region": [
-1.3197004795898053,
0.6988582109,
-1.3196595204101946,
0.6988897891,
0,
80
20
]
},
"geometricError": 0,
"content": {
"url": "instancedOct32POrientationWithBatchTable.i3dm"
"url": "batchedColorsTranslucent.b3dm"
}
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@
"properties": {
"id": {
"minimum": 0,
"maximum": 99
"maximum": 9
},
"Longitude": {
"minimum": -1.3197004048940548,
"maximum": -1.3196602716044172
"minimum": -1.3196972173766555,
"maximum": -1.3196718547473905
},
"Latitude": {
"minimum": 0.6988585409308616,
"maximum": 0.6988894207110236
"minimum": 0.6988624606923348,
"maximum": 0.6988888301460953
},
"Height": {
"minimum": 0,
"maximum": 80
"minimum": 6.2074098233133554,
"maximum": 12.83180232718587
}
},
"geometricError": 40,
"refine": "add",
"geometricError": 70,
"root": {
"refine": "add",
"boundingVolume": {
"region": [
-1.3197004795898053,
0.6988582109,
-1.3196595204101946,
0.6988897891,
0,
80
20
]
},
"geometricError": 0,
"content": {
"url": "instancedQuantizedOct32POrientationWithBatchTable.i3dm"
"url": "batchedDeprecated.b3dm"
}
}
}
Binary file not shown.
23 changes: 23 additions & 0 deletions Specs/Data/Cesium3DTiles/Batched/BatchedNoBatchIds/tileset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"asset": {
"version": "0.0"
},
"geometricError": 70,
"root": {
"refine": "add",
"boundingVolume": {
"region": [
-1.3197004795898053,
0.6988582109,
-1.3196595204101946,
0.6988897891,
0,
20
]
},
"geometricError": 0,
"content": {
"url": "batchedNoBatchIds.b3dm"
}
}
}
Binary file not shown.
Binary file not shown.
16 changes: 10 additions & 6 deletions Specs/Data/Cesium3DTiles/Batched/BatchedTextured/tileset.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@
"version": "0.0"
},
"properties": {
"id": {
"minimum": 0,
"maximum": 9
},
"Longitude": {
"minimum": -1.3196975700111178,
"maximum": -1.3196648446060844
"minimum": -1.3196972173766555,
"maximum": -1.3196718547473905
},
"Latitude": {
"minimum": 0.6988688652634713,
"maximum": 0.698886371486204
"minimum": 0.6988624606923348,
"maximum": 0.6988888301460953
},
"Height": {
"minimum": 6.161747192963958,
"maximum": 12.778013898059726
"minimum": 6.2074098233133554,
"maximum": 12.83180232718587
}
},
"geometricError": 70,
Expand Down
Binary file not shown.
12 changes: 6 additions & 6 deletions Specs/Data/Cesium3DTiles/Batched/BatchedTranslucent/tileset.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
"maximum": 9
},
"Longitude": {
"minimum": -1.3196812329810825,
"maximum": -1.3196599624193912
"minimum": -1.3196972173766555,
"maximum": -1.3196718547473905
},
"Latitude": {
"minimum": 0.6988634273243843,
"maximum": 0.6988863863403311
"minimum": 0.6988624606923348,
"maximum": 0.6988888301460953
},
"Height": {
"minimum": 6,
"maximum": 14
"minimum": 6.2074098233133554,
"maximum": 12.83180232718587
}
},
"geometricError": 70,
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
"maximum": 9
},
"Longitude": {
"minimum": -1.3197000541327293,
"maximum": -1.3196647916486712
"minimum": -1.3196972173766555,
"maximum": -1.3196718547473905
},
"Latitude": {
"minimum": 0.6988632475321589,
"maximum": 0.6988890296629459
"minimum": 0.6988624606923348,
"maximum": 0.6988888301460953
},
"Height": {
"minimum": 6,
"maximum": 14
"minimum": 6.2074098233133554,
"maximum": 12.83180232718587
}
},
"geometricError": 70,
Expand Down
Binary file not shown.
Loading