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 - i3dm RTC_CENTER #5089

Merged
merged 1 commit into from
Mar 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
9 changes: 9 additions & 0 deletions Source/Scene/Instanced3DModel3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,12 @@ define([

var eastNorthUp = featureTable.getGlobalProperty('EAST_NORTH_UP');

var rtcCenter;
var rtcCenterArray = featureTable.getGlobalProperty('RTC_CENTER');
if (defined(rtcCenterArray)) {
rtcCenter = Cartesian3.unpack(rtcCenterArray);
}

var instances = collectionOptions.instances;
var instancePosition = new Cartesian3();
var instancePositionArray = new Array(3);
Expand Down Expand Up @@ -371,6 +377,9 @@ define([
}
}
Cartesian3.unpack(position, 0, instancePosition);
if (defined(rtcCenter)) {
Cartesian3.add(instancePosition, rtcCenter, instancePosition);
}
instanceTranslationRotationScale.translation = instancePosition;

// Get the instance rotation
Expand Down
Binary file not shown.
29 changes: 29 additions & 0 deletions Specs/Data/Cesium3DTiles/Instanced/InstancedRTC/tileset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"asset": {
"version": "0.0"
},
"properties": {
"Height": {
"minimum": 20,
"maximum": 20
}
},
"geometricError": 70,
"root": {
"refine": "add",
"boundingVolume": {
"region": [
-1.3197004795898053,
0.6988582109,
-1.3196595204101946,
0.6988897891,
0,
30
]
},
"geometricError": 0,
"content": {
"url": "instancedRTC.i3dm"
}
}
}
7 changes: 7 additions & 0 deletions Specs/Scene/Instanced3DModel3DTileContentSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ defineSuite([
var oct16POrientationUrl = './Data/Cesium3DTiles/Instanced/InstancedOct32POrientation/';
var scaleUrl = './Data/Cesium3DTiles/Instanced/InstancedScale/';
var scaleNonUniformUrl = './Data/Cesium3DTiles/Instanced/InstancedScaleNonUniform/';
var rtcUrl = './Data/Cesium3DTiles/Instanced/InstancedRTC';
var quantizedUrl = './Data/Cesium3DTiles/Instanced/InstancedQuantized/';
var quantizedOct32POrientationUrl = './Data/Cesium3DTiles/Instanced/InstancedQuantizedOct32POrientation/';
var withTransformUrl = './Data/Cesium3DTiles/Instanced/InstancedWithTransform/';
Expand Down Expand Up @@ -184,6 +185,12 @@ defineSuite([
});
});

it('renders with RTC_CENTER semantic', function() {
return Cesium3DTilesTester.loadTileset(scene, rtcUrl).then(function(tileset) {
Cesium3DTilesTester.expectRenderTileset(scene, tileset);
});
});

it('renders with feature defined quantized position', function() {
return Cesium3DTilesTester.loadTileset(scene, quantizedUrl).then(function(tileset) {
Cesium3DTilesTester.expectRenderTileset(scene, tileset);
Expand Down