Skip to content

Commit

Permalink
Move Sandcastle example data to ion
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeshurun Hembd committed May 16, 2024
1 parent 8bb698e commit 6155fa4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 116 deletions.
15 changes: 0 additions & 15 deletions Apps/SampleData/models/SpecularTest/LICENSE.md

This file was deleted.

53 changes: 0 additions & 53 deletions Apps/SampleData/models/SpecularTest/README.md

This file was deleted.

Binary file not shown.
26 changes: 0 additions & 26 deletions Apps/SampleData/models/SpecularTest/metadata.json

This file was deleted.

36 changes: 14 additions & 22 deletions Apps/Sandcastle/gallery/development/glTF PBR Specular.html
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,20 @@
);

let model;
loadModel(
"../../SampleData/models/SpecularTest/glTF-Binary/SpecularTest.glb"
);
try {
const resource = await Cesium.IonResource.fromAssetId(2572779);
model = await Cesium.Model.fromGltfAsync({
url: resource,
modelMatrix: modelMatrix,
imageBasedLighting,
});

scene.primitives.add(model);

model.readyEvent.addEventListener(() => zoomToModel(model));
} catch (error) {
window.alert(`Error loading model: ${error}`);
}

Sandcastle.addToggleButton(
"Enable KHR_materials_specular",
Expand All @@ -329,25 +340,6 @@
}
);

async function loadModel(modelURL) {
try {
model = await Cesium.Model.fromGltfAsync({
url: modelURL,
modelMatrix: modelMatrix,
imageBasedLighting,
});

scene.primitives.removeAll();
scene.primitives.add(model);

model.readyEvent.addEventListener(() => {
zoomToModel(model);
});
} catch (error) {
window.alert(`Error loading model: ${error}`);
}
}

function zoomToModel(model) {
const controller = scene.screenSpaceCameraController;
const r = Math.max(
Expand Down

0 comments on commit 6155fa4

Please sign in to comment.