-
Notifications
You must be signed in to change notification settings - Fork 0
/
gaussian-splat-viewer.html
69 lines (63 loc) · 2.39 KB
/
gaussian-splat-viewer.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PlayCanvas Gaussian Splat Viewer</title>
<!-- Import map for PlayCanvas engine -->
<script type="importmap">
{
"imports": {
"playcanvas": "https://cdn.jsdelivr.net/npm/[email protected]/build/playcanvas.mjs"
}
}
</script>
<style>
</style>
<!-- Import PlayCanvas Web Components -->
<script type="module" src="https://cdn.jsdelivr.net/npm/@playcanvas/[email protected]/dist/pwc.mjs"></script>
</head>
<body>
<div id="container">
<pc-app>
<!-- Define the Gaussian Splat asset -->
<pc-asset id="my-splat"
type="gsplat"
src="dmitry.ply"
preload>
</pc-asset>
<pc-asset id="camera-controls"
src="https://cdn.jsdelivr.net/npm/[email protected]/scripts/esm/camera-controls.mjs"
preload>
</pc-asset>
<pc-scene>
<!-- Camera setup -->
<pc-entity name="camera root">
<pc-entity name="camera" position="0 2 3.5">
<pc-camera></pc-camera>
<pc-scripts>
<pc-script name="cameraControls" attributes='{
"enableFly": false,
"enablePan": false,
"focusPoint": [0, 2, 0],
"pitchRange": [0, 90],
"sceneSize": 3,
"zoomMin": 0.5,
"zoomMax": 3
}'></pc-script>
</pc-scripts>
</pc-entity>
</pc-entity>
<!-- Light setup -->
<pc-entity name="light" rotation="45 45 0">
<pc-light type="directional" intensity="1"></pc-light>
</pc-entity>
<!-- Gaussian Splat entity -->
<pc-entity name="splat-model">
<pc-splat asset="my-splat"></pc-splat>
</pc-entity>
</pc-scene>
</pc-app>
</div>
</body>
</html>