Skip to content
Open
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
109 changes: 109 additions & 0 deletions examples/distance-rescale/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Spark - Distance Measurement & Rescale</title>
<style>
body {
margin: 0;
overflow: hidden;
font-family: Arial, sans-serif;
background: #000;
}

header {
position: absolute;
color: silver;
font-family: sans-serif;
padding: 12px 16px;
text-align: left;
width: calc(100vw - 32px);
pointer-events: none;
text-shadow:
2px 2px 4px rgba(0, 0, 0, 0.8),
-1px -1px 2px rgba(0, 0, 0, 0.6),
1px -1px 2px rgba(0, 0, 0, 0.6),
-1px 1px 2px rgba(0, 0, 0, 0.6);
-webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.7);
z-index: 10;
}

#file-input-container {
position: absolute;
bottom: 20px;
left: 20px;
z-index: 100;
}

#file-input-container label {
background: #333;
color: white;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
font-size: 14px;
}

#file-input-container label:hover {
background: #555;
}

#file-input {
display: none;
}

#distance-display {
position: absolute;
bottom: 20px;
right: 20px;
background: rgba(0, 0, 0, 0.7);
color: white;
padding: 15px 20px;
border-radius: 8px;
font-size: 16px;
z-index: 100;
display: none;
}

#distance-display .label {
color: #aaa;
font-size: 12px;
margin-bottom: 5px;
}

#distance-display .value {
font-size: 24px;
font-weight: bold;
}
</style>
</head>

<body>
<header id="instructions">Click on the model to select first measurement point</header>

<div id="file-input-container">
<label for="file-input">Load PLY File</label>
<input type="file" id="file-input" accept=".ply,.spz,.splat">
</div>

<div id="distance-display">
<div class="label">Distance</div>
<div class="value" id="distance-value">0.000</div>
</div>

<script type="importmap">
{
"imports": {
"three": "/examples/js/vendor/three/build/three.module.js",
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
"@sparkjsdev/spark": "/dist/spark.module.js",
"lil-gui": "/examples/js/vendor/lil-gui/dist/lil-gui.esm.js"
}
}
</script>
<script type="module" src="main.js"></script>
</body>

</html>
Loading