-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
54 lines (40 loc) · 1.52 KB
/
index.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
<html>
<head>
<title>Tetrahedron</title>
<style>
body { margin: 0; }
canvas { display: block; }
</style>
</head>
<body>
<script src="src/js/three.js"></script>
<script src="src/js/OrbitControls.js"></script>
<script src='https://cdn.jsdelivr.net/npm/[email protected]/build/dat.gui.min.js'></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/matrix.umd.min.js"></script>
<script src="src/js/three_stuff.js"></script>
<script src="src/js/gui.js"></script>
<script src="solution.js"></script>
<script>
//tetrahedron base points
const _Q = new Point(2, 3, 3);
const _P = new Point(8, 1, 2);
const _R = new Point(6, 1, 9);
const E = new Point(5, 5, 4);
const _Lq = distance(E, _Q);
const _Lp = distance(E, _P);
const _Lr = distance(E, _R);
var scene = new THREE.Scene();
initializeGui(scene);
function prepareScene(scene, camera) {
const solution = find4thVertex(_Q, _P, _R, _Lq, _Lp, _Lr);
// rendering
addVector(scene, _P, solution, 0xFFFF00);
controlBaseTriangle(scene, true);
controlPointLabels(scene, true);
controlSpheres(scene, true);
camera.position.set(14, 6, -2);
}
threeJsMain(scene, prepareScene);
</script>
</body>
</html>