-
Notifications
You must be signed in to change notification settings - Fork 0
/
plotVG.html
137 lines (106 loc) · 15 KB
/
plotVG.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html>
<head>
<title>PyntCloud</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
color: #cccccc;
font-family: Monospace;
font-size: 13px;
text-align: center;
background-color: #050505;
margin: 0px;
overflow: hidden;
}
#logo_container {
position: absolute;
top: 0px;
width: 100%;
}
#PyntCloudLogo {
height: 100px;
}
</style>
</head>
<body>
<div>
<img id="PyntCloudLogo" src="pyntcloud_plot_assets/pyntcloud_logo.png">
</div>
<div id="container">
</div>
<script src="pyntcloud_plot_assets/three.min.js"></script>
<script src="pyntcloud_plot_assets/Detector.js"></script>
<script src="pyntcloud_plot_assets/OrbitControls.js"></script>
<script src="pyntcloud_plot_assets/stats.min.js"></script>
<script src="pyntcloud_plot_assets/jquery.min.js"></script>
<script src="pyntcloud_plot_assets/PLYLoader.js"></script>
<script>
if (!Detector.webgl) Detector.addGetWebGLMessage();
var container, stats;
var camera, scene, renderer;
var points;
init();
animate();
function init() {
var camera_x = 126.0;
var camera_y = 78.00000000000006;
var camera_z = 102.0;
var look_x = 32.06989247311828;
var look_y = 30.7204301075269;
var look_z = 31.0;
var X = new Float32Array([0.0, 1.0, 1.0, 2.0, 3.0, 4.0, 5.0, 5.0, 6.0, 6.0, 6.0, 7.0, 7.0, 7.0, 7.0, 7.0, 8.0, 8.0, 8.0, 9.0, 9.0, 9.0, 10.0, 10.0, 10.0, 11.0, 11.0, 11.0, 12.0, 12.0, 12.0, 13.0, 13.0, 13.0, 13.0, 13.0, 14.0, 14.0, 14.0, 15.0, 15.0, 15.0, 16.0, 16.0, 16.0, 17.0, 17.0, 17.0, 18.0, 18.0, 18.0, 19.0, 19.0, 19.0, 20.0, 20.0, 20.0, 21.0, 21.0, 21.0, 22.0, 22.0, 22.0, 23.0, 23.0, 23.0, 24.0, 24.0, 24.0, 25.0, 25.0, 25.0, 26.0, 26.0, 26.0, 27.0, 27.0, 28.0, 28.0, 28.0, 28.0, 29.0, 29.0, 29.0, 30.0, 30.0, 30.0, 31.0, 31.0, 32.0, 32.0, 32.0, 33.0, 33.0, 34.0, 34.0, 34.0, 35.0, 35.0, 36.0, 36.0, 36.0, 37.0, 37.0, 37.0, 37.0, 38.0, 38.0, 38.0, 39.0, 39.0, 39.0, 40.0, 40.0, 40.0, 41.0, 41.0, 41.0, 41.0, 41.0, 42.0, 42.0, 42.0, 43.0, 43.0, 43.0, 44.0, 44.0, 44.0, 45.0, 45.0, 45.0, 45.0, 45.0, 46.0, 46.0, 46.0, 47.0, 47.0, 47.0, 47.0, 48.0, 48.0, 48.0, 48.0, 49.0, 49.0, 49.0, 49.0, 49.0, 49.0, 50.0, 50.0, 50.0, 51.0, 51.0, 51.0, 52.0, 52.0, 52.0, 52.0, 52.0, 53.0, 53.0, 53.0, 54.0, 54.0, 54.0, 55.0, 55.0, 55.0, 56.0, 56.0, 56.0, 56.0, 56.0, 57.0, 57.0, 57.0, 58.0, 58.0, 59.0, 60.0, 61.0, 62.0, 63.0]);
var Y = new Float32Array([24.000000000000014, 24.000000000000014, 25.000000000000018, 25.000000000000018, 25.000000000000018, 25.000000000000018, 25.000000000000018, 25.000000000000018, 25.000000000000018, 25.000000000000018, 25.000000000000018, 25.000000000000018, 25.000000000000018, 25.000000000000018, 26.000000000000018, 26.000000000000018, 26.000000000000018, 26.000000000000018, 26.000000000000018, 26.000000000000018, 26.000000000000018, 26.000000000000018, 26.000000000000018, 26.000000000000018, 26.000000000000018, 26.000000000000018, 26.000000000000018, 26.000000000000018, 26.000000000000018, 26.000000000000018, 26.000000000000018, 26.000000000000018, 26.000000000000018, 27.000000000000018, 27.000000000000018, 27.000000000000018, 27.000000000000018, 27.000000000000018, 27.000000000000018, 27.000000000000018, 27.000000000000018, 27.000000000000018, 27.000000000000018, 27.000000000000018, 27.000000000000018, 27.000000000000018, 27.000000000000018, 27.000000000000018, 27.000000000000018, 27.000000000000018, 27.000000000000018, 28.000000000000018, 28.000000000000018, 28.000000000000018, 28.000000000000018, 28.000000000000018, 28.000000000000018, 28.000000000000018, 28.000000000000018, 28.000000000000018, 28.000000000000018, 28.000000000000018, 28.000000000000018, 28.000000000000018, 28.000000000000018, 28.000000000000018, 29.000000000000018, 29.000000000000018, 29.000000000000018, 29.000000000000018, 29.000000000000018, 29.000000000000018, 29.000000000000018, 29.000000000000018, 29.000000000000018, 29.000000000000018, 29.000000000000018, 29.000000000000018, 29.000000000000018, 30.00000000000002, 30.00000000000002, 30.00000000000002, 30.00000000000002, 30.00000000000002, 30.00000000000002, 30.00000000000002, 30.00000000000002, 30.00000000000002, 30.00000000000002, 30.00000000000002, 30.00000000000002, 30.00000000000002, 31.00000000000002, 31.00000000000002, 30.00000000000002, 31.00000000000002, 31.00000000000002, 31.00000000000002, 31.00000000000002, 31.00000000000002, 31.00000000000002, 31.00000000000002, 31.00000000000002, 31.00000000000002, 32.00000000000002, 32.00000000000002, 32.00000000000002, 32.00000000000002, 32.00000000000002, 32.00000000000002, 32.00000000000002, 32.00000000000002, 32.00000000000002, 32.00000000000002, 32.00000000000002, 32.00000000000002, 32.00000000000002, 32.00000000000002, 33.00000000000002, 33.00000000000002, 33.00000000000002, 33.00000000000002, 33.00000000000002, 33.00000000000002, 33.00000000000002, 33.00000000000002, 33.00000000000002, 33.00000000000002, 33.00000000000002, 33.00000000000002, 33.00000000000002, 34.00000000000002, 34.00000000000002, 34.00000000000002, 34.00000000000002, 34.00000000000002, 34.00000000000002, 34.00000000000002, 34.00000000000002, 34.00000000000002, 34.00000000000002, 34.00000000000002, 34.00000000000002, 34.00000000000002, 34.00000000000002, 34.00000000000002, 34.00000000000002, 34.00000000000002, 35.00000000000002, 35.00000000000002, 35.00000000000002, 35.00000000000002, 35.00000000000002, 35.00000000000002, 35.00000000000002, 35.00000000000002, 35.00000000000002, 35.00000000000002, 35.00000000000002, 35.00000000000002, 35.00000000000002, 36.00000000000002, 36.00000000000002, 36.00000000000002, 36.00000000000002, 36.00000000000002, 36.00000000000002, 36.00000000000002, 36.00000000000002, 36.00000000000002, 36.00000000000002, 36.00000000000002, 36.00000000000002, 37.00000000000002, 37.00000000000002, 37.00000000000002, 37.00000000000002, 37.00000000000002, 37.00000000000002, 37.00000000000002, 37.00000000000002, 37.00000000000002, 38.00000000000003, 38.00000000000003, 38.00000000000003, 39.00000000000003]);
var Z = new Float32Array([31.0, 31.0, 31.0, 31.0, 31.0, 31.0, 12.0, 31.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 12.0, 50.0, 12.0, 31.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 51.0, 12.0, 31.0, 51.0, 12.0, 51.0, 31.0, 12.0, 51.0, 12.0, 51.0, 12.0, 31.0, 51.0, 12.0, 51.0, 12.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 50.0, 51.0, 12.0, 31.0, 50.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 13.0, 31.0, 51.0, 31.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 13.0, 31.0, 51.0, 12.0, 31.0, 51.0, 12.0, 31.0, 31.0, 31.0, 31.0, 31.0, 31.0]);
var R = new Float32Array([0.798216, 0.050383, 0.050383, 0.798216, 0.798216, 0.494877, 0.050383, 0.494877, 0.494877, 0.798216, 0.798216, 0.798216, 0.050383, 0.494877, 0.050383, 0.050383, 0.494877, 0.494877, 0.798216, 0.798216, 0.798216, 0.494877, 0.494877, 0.494877, 0.798216, 0.973416, 0.494877, 0.050383, 0.494877, 0.798216, 0.798216, 0.050383, 0.494877, 0.494877, 0.050383, 0.050383, 0.494877, 0.798216, 0.494877, 0.494877, 0.494877, 0.798216, 0.798216, 0.798216, 0.494877, 0.494877, 0.798216, 0.494877, 0.494877, 0.494877, 0.798216, 0.798216, 0.798216, 0.494877, 0.798216, 0.494877, 0.798216, 0.798216, 0.798216, 0.494877, 0.494877, 0.798216, 0.798216, 0.494877, 0.494877, 0.798216, 0.798216, 0.798216, 0.798216, 0.494877, 0.798216, 0.050383, 0.798216, 0.494877, 0.798216, 0.494877, 0.798216, 0.494877, 0.494877, 0.050383, 0.798216, 0.798216, 0.494877, 0.494877, 0.798216, 0.050383, 0.494877, 0.494877, 0.798216, 0.050383, 0.940015, 0.798216, 0.798216, 0.494877, 0.494877, 0.494877, 0.798216, 0.798216, 0.494877, 0.798216, 0.940015, 0.494877, 0.050383, 0.050383, 0.050383, 0.798216, 0.798216, 0.050383, 0.494877, 0.494877, 0.494877, 0.494877, 0.494877, 0.798216, 0.494877, 0.494877, 0.494877, 0.798216, 0.050383, 0.050383, 0.050383, 0.798216, 0.798216, 0.798216, 0.050383, 0.973416, 0.798216, 0.798216, 0.050383, 0.494877, 0.494877, 0.050383, 0.798216, 0.050383, 0.798216, 0.494877, 0.494877, 0.494877, 0.798216, 0.050383, 0.494877, 0.494877, 0.494877, 0.050383, 0.050383, 0.494877, 0.050383, 0.050383, 0.050383, 0.494877, 0.494877, 0.798216, 0.050383, 0.050383, 0.050383, 0.973416, 0.973416, 0.050383, 0.494877, 0.050383, 0.494877, 0.050383, 0.798216, 0.798216, 0.494877, 0.494877, 0.494877, 0.494877, 0.494877, 0.494877, 0.973416, 0.050383, 0.494877, 0.050383, 0.050383, 0.050383, 0.798216, 0.494877, 0.050383, 0.050383, 0.798216, 0.798216, 0.494877, 0.798216, 0.798216, 0.798216]);
var G = new Float32Array([0.280197, 0.029803, 0.029803, 0.280197, 0.280197, 0.01199, 0.029803, 0.01199, 0.01199, 0.280197, 0.280197, 0.280197, 0.029803, 0.01199, 0.029803, 0.029803, 0.01199, 0.01199, 0.280197, 0.280197, 0.280197, 0.01199, 0.01199, 0.01199, 0.280197, 0.585761, 0.01199, 0.029803, 0.01199, 0.280197, 0.280197, 0.029803, 0.01199, 0.01199, 0.029803, 0.029803, 0.01199, 0.280197, 0.01199, 0.01199, 0.01199, 0.280197, 0.280197, 0.280197, 0.01199, 0.01199, 0.280197, 0.01199, 0.01199, 0.01199, 0.280197, 0.280197, 0.280197, 0.01199, 0.280197, 0.01199, 0.280197, 0.280197, 0.280197, 0.01199, 0.01199, 0.280197, 0.280197, 0.01199, 0.01199, 0.280197, 0.280197, 0.280197, 0.280197, 0.01199, 0.280197, 0.029803, 0.280197, 0.01199, 0.280197, 0.01199, 0.280197, 0.01199, 0.01199, 0.029803, 0.280197, 0.280197, 0.01199, 0.01199, 0.280197, 0.029803, 0.01199, 0.01199, 0.280197, 0.029803, 0.975158, 0.280197, 0.280197, 0.01199, 0.01199, 0.01199, 0.280197, 0.280197, 0.01199, 0.280197, 0.975158, 0.01199, 0.029803, 0.029803, 0.029803, 0.280197, 0.280197, 0.029803, 0.01199, 0.01199, 0.01199, 0.01199, 0.01199, 0.280197, 0.01199, 0.01199, 0.01199, 0.280197, 0.029803, 0.029803, 0.029803, 0.280197, 0.280197, 0.280197, 0.029803, 0.585761, 0.280197, 0.280197, 0.029803, 0.01199, 0.01199, 0.029803, 0.280197, 0.029803, 0.280197, 0.01199, 0.01199, 0.01199, 0.280197, 0.029803, 0.01199, 0.01199, 0.01199, 0.029803, 0.029803, 0.01199, 0.029803, 0.029803, 0.029803, 0.01199, 0.01199, 0.280197, 0.029803, 0.029803, 0.029803, 0.585761, 0.585761, 0.029803, 0.01199, 0.029803, 0.01199, 0.029803, 0.280197, 0.280197, 0.01199, 0.01199, 0.01199, 0.01199, 0.01199, 0.01199, 0.585761, 0.029803, 0.01199, 0.029803, 0.029803, 0.029803, 0.280197, 0.01199, 0.029803, 0.029803, 0.280197, 0.280197, 0.01199, 0.280197, 0.280197, 0.280197]);
var B = new Float32Array([0.469538, 0.527975, 0.527975, 0.469538, 0.469538, 0.657865, 0.527975, 0.657865, 0.657865, 0.469538, 0.469538, 0.469538, 0.527975, 0.657865, 0.527975, 0.527975, 0.657865, 0.657865, 0.469538, 0.469538, 0.469538, 0.657865, 0.657865, 0.657865, 0.469538, 0.25154, 0.657865, 0.527975, 0.657865, 0.469538, 0.469538, 0.527975, 0.657865, 0.657865, 0.527975, 0.527975, 0.657865, 0.469538, 0.657865, 0.657865, 0.657865, 0.469538, 0.469538, 0.469538, 0.657865, 0.657865, 0.469538, 0.657865, 0.657865, 0.657865, 0.469538, 0.469538, 0.469538, 0.657865, 0.469538, 0.657865, 0.469538, 0.469538, 0.469538, 0.657865, 0.657865, 0.469538, 0.469538, 0.657865, 0.657865, 0.469538, 0.469538, 0.469538, 0.469538, 0.657865, 0.469538, 0.527975, 0.469538, 0.657865, 0.469538, 0.657865, 0.469538, 0.657865, 0.657865, 0.527975, 0.469538, 0.469538, 0.657865, 0.657865, 0.469538, 0.527975, 0.657865, 0.657865, 0.469538, 0.527975, 0.131326, 0.469538, 0.469538, 0.657865, 0.657865, 0.657865, 0.469538, 0.469538, 0.657865, 0.469538, 0.131326, 0.657865, 0.527975, 0.527975, 0.527975, 0.469538, 0.469538, 0.527975, 0.657865, 0.657865, 0.657865, 0.657865, 0.657865, 0.469538, 0.657865, 0.657865, 0.657865, 0.469538, 0.527975, 0.527975, 0.527975, 0.469538, 0.469538, 0.469538, 0.527975, 0.25154, 0.469538, 0.469538, 0.527975, 0.657865, 0.657865, 0.527975, 0.469538, 0.527975, 0.469538, 0.657865, 0.657865, 0.657865, 0.469538, 0.527975, 0.657865, 0.657865, 0.657865, 0.527975, 0.527975, 0.657865, 0.527975, 0.527975, 0.527975, 0.657865, 0.657865, 0.469538, 0.527975, 0.527975, 0.527975, 0.25154, 0.25154, 0.527975, 0.657865, 0.527975, 0.657865, 0.527975, 0.469538, 0.469538, 0.657865, 0.657865, 0.657865, 0.657865, 0.657865, 0.657865, 0.25154, 0.527975, 0.657865, 0.527975, 0.527975, 0.527975, 0.469538, 0.657865, 0.527975, 0.527975, 0.469538, 0.469538, 0.657865, 0.469538, 0.469538, 0.469538]);
var S_x = 1.0;
var S_y = 1.0000000000000007;
var S_z = 1.0;
var n_voxels = 186;
var axis_size = 0;
container = document.getElementById('container');
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.position.x = camera_x;
camera.position.y = camera_y;
camera.position.z = camera_z;
camera.up = new THREE.Vector3(0, 0, 1);
if (axis_size > 0) {
var axisHelper = new THREE.AxisHelper(axis_size);
scene.add(axisHelper);
}
var geometry = new THREE.BoxGeometry(S_x, S_y, S_z);
for (var i = 0; i < n_voxels; i++) {
var mesh = new THREE.Mesh(geometry, new THREE.MeshBasicMaterial());
mesh.material.color.setRGB(R[i], G[i], B[i]);
mesh.position.x = X[i];
mesh.position.y = Y[i];
mesh.position.z = Z[i];
scene.add(mesh);
}
renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
controls = new THREE.OrbitControls(camera, renderer.domElement);
controls.target.copy(new THREE.Vector3(look_x, look_y, look_z));
camera.lookAt(new THREE.Vector3(look_x, look_y, look_z));
container.appendChild(renderer.domElement);
window.addEventListener('resize', onWindowResize, false);
}
function onWindowResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
}
function animate() {
requestAnimationFrame(animate);
render();
}
function render() {
renderer.render(scene, camera);
}
</script>
</body>
</html>