Add ability to load sample files from server
This commit is contained in:
parent
24a86cb77a
commit
072b54cafe
|
|
@ -1,2 +1,3 @@
|
|||
*.jpg filter=lfs diff=lfs merge=lfs -text
|
||||
*.tiff filter=lfs diff=lfs merge=lfs -text
|
||||
*.data filter=lfs diff=lfs merge=lfs -text
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@
|
|||
<div id="bottom-panel">
|
||||
<input type="file" id="file-upload-file-input" accept="image/tiff, .tif, .tiff">
|
||||
<button id="clear-scene-button">Clear Scene</button>
|
||||
<button id="load-small-sample-button">Load Small Sample</button>
|
||||
<button id="load-medium-sample-button">Load Medium Sample</button>
|
||||
<button id="load-large-sample-button">Load Large Sample</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -20,3 +20,8 @@ body {
|
|||
flex-grow: 0;
|
||||
margin: 0.4rem;
|
||||
}
|
||||
|
||||
button {
|
||||
margin-left: 0.2rem;
|
||||
margin-right: 0.2rem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,30 @@ async function run() {
|
|||
clear_scene = true;
|
||||
});
|
||||
|
||||
[
|
||||
{
|
||||
buttonId: "load-small-sample-button",
|
||||
url: "small_sample.tiff"
|
||||
},
|
||||
{
|
||||
buttonId: "load-medium-sample-button",
|
||||
url: "medium_sample.tiff"
|
||||
},
|
||||
{
|
||||
buttonId: "load-large-sample-button",
|
||||
url: "large_sample.tiff"
|
||||
}
|
||||
].forEach( (sample) => {
|
||||
let loadSampleButton = document.getElementById(sample.buttonId);
|
||||
loadSampleButton.addEventListener("click", async () => {
|
||||
const response = await fetch(sample.url);
|
||||
if(!response.ok) {
|
||||
console.error("Couild not load sample file.")
|
||||
}
|
||||
test_file_data = await response.blob()
|
||||
});
|
||||
});
|
||||
|
||||
while(true)
|
||||
{
|
||||
await pteropus.render();
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue