-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
126 lines (118 loc) · 4.57 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Camera Aligner</title>
<link rel="stylesheet" href="style.css">
<script src="linear-algebra.js"></script>
</head>
<body>
<header>
<h1>Camera Aligner</h1>
</header>
<main>
<aside hidden>
<h2>Settings</h2>
<label>
File:
<input type="file" accept="image/*" id="image-file" onchange="uploadImage(this.files[0])">
</label>
<label>
Distance to origin:
<input type="number" id="distance-to-origin" value="5" onchange="refresh()">
</label>
<label>
Axis 1:
<select id="axis1" onchange="refresh()">
<option value=" x" selected>X</option>
<option value="-x">-X</option>
<option value=" y">Y</option>
<option value="-y">-Y</option>
<option value=" z">Z</option>
<option value="-z">-Z</option>
</select>
</label>
<label>
Axis 2:
<select id="axis2" onchange="refresh()">
<option value=" x">X</option>
<option value="-x">-X</option>
<option value=" y" selected>Y</option>
<option value="-y">-Y</option>
<option value=" z">Z</option>
<option value="-z">-Z</option>
</select>
</label>
<div>
Sensor size:
<div class="sensor-size">
<input type="number" id="sensor-width" value="32" onchange="updateSensorSize(0)"><span>x</span>
<input type="number" id="sensor-height" value="24" onchange="updateSensorSize(1)"><span>mm</span>
</div>
</div>
<div id="results" hidden>
<hr>
<h2>Results</h2>
<section>
Focal length:
<br>
<span id="focal-length" class="value"></span>
</section>
<hr>
<section>
Field of view (longest side):
<br>
<span id="fov" class="value"></span>
</section>
<hr>
<section>
Location:
<div class="labels-values">
<div class="labels">
<span>x:</span>
<span>y:</span>
<span>z:</span>
</div>
<div class="values">
<span id="location-x"></span><br>
<span id="location-y"></span><br>
<span id="location-z"></span>
</div>
</div>
</section>
<hr>
<section>
Euler rotation:
<div class="labels-values">
<div class="labels">
<span>x:</span>
<span>y:</span>
<span>z:</span>
</div>
<div class="values">
<span id="rotation-x"></span><br>
<span id="rotation-y"></span><br>
<span id="rotation-z"></span>
</div>
</div>
</section>
<hr>
<input type="button" value="Copy Blender console command" onclick="navigator.clipboard.writeText(getBlenderCommand())">
<textarea spellcheck="false" rows="2" id="blender-command"></textarea>
</div>
</aside>
<div id="canvas-container" onclick="triggerUpload()" ondragover="event.preventDefault()" ondrop="loadDropped(event)">
<canvas id="main-canvas">
</canvas>
<div id="upload" ondragover="event.preventDefault()" ondrop="loadDropped(event)">
<h3>Click here to select an image and begin</h3>
<h4>Or drag and drop an image</h4>
</div>
</div>
</main>
<img hidden id="source-img">
<script src="script.js"></script>
</body>
</html>