-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathth3.htm
43 lines (32 loc) · 1.04 KB
/
th3.htm
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Create, draw and update TH3 object</title>
<link rel="shortcut icon" href="../img/RootIcon.ico"/>
</head>
<body>
<div id="object_draw" style="width: 1200px; height: 800px"></div>
</body>
<script type='module'>
import { createHistogram, redraw } from '../modules/main.mjs';
let cnt = 0;
let histo = createHistogram('TH3I', 20, 20, 20);
histo.fXaxis.fXmin = -10;
histo.fXaxis.fXmax = 10;
histo.fYaxis.fXmin = -10;
histo.fYaxis.fXmax = 10;
histo.fZaxis.fXmin = -10;
histo.fZaxis.fXmax = 10;
histo.fName = 'generated';
histo.fFillColor = 3;
function updateGUI() {
histo.fTitle = `Drawing ${cnt++}`;
let angle1 = cnt*Math.PI/70, angle2 = cnt*Math.PI/10;
histo.Fill(9*Math.sin(angle1), 9*Math.cos(angle2), 9*Math.sin(angle2));
redraw('object_draw', histo, 'box2');
}
updateGUI();
setInterval(updateGUI, 300);
</script>
</html>