-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
139 lines (99 loc) · 5.92 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
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>De Casteljau's Algorithm</title>
<meta name="author" content="tiago maranhao | tiago.wtf">
<meta name="description" content="An interactive tool for building Bézier curves and visualizing the De Casteljau's algorithm.">
<meta property="og:image" content="https://tiago-kth.github.io/visgraf/thumb.png">
<meta property="og:description" content="An interactive tool for building Bézier curves and visualizing the De Casteljau's algorithm.">
<meta property="og:title" content="Visualizing the de Casteljau's Algorithm">
<meta property="og:url" content="https://tiago-kth.github.io/visgraf/">
<meta property="og:type" content="website">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Visualizing the de Casteljau's Algorithm">
<meta name="twitter:description" content="An interactive tool for building Bézier curves and visualizing the De Casteljau's algorithm.">
<meta name="twitter:site" content="@tiagombp">
<meta name="twitter:creator" content="@tiagombp">
<meta name="twitter:image" content="https://tiago-kth.github.io/visgraf/thumb.png">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Alegreya+Sans:ital,wght@0,100;0,300;0,400;0,500;0,700;0,800;0,900;1,400&family=Alegreya:wght@400;500;600;700;800;900&family=Fira+Code:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="canvas-container-opening">
<canvas class="opening"></canvas>
</div>
<div class="text-container">
<div class="title">
<h1>Visualizing the de Casteljau's Algorithm</h1>
<div class="subtitle">
<p>A bonus project for Tino Weinkauf's "Introduction to Visualization and Computer Graphics" course at KTH Royal Institute of Technology, very much inspired by <a href="https://acegikmo.com/">Freya Hólmer</a>'s "<a href="https://www.youtube.com/watch?v=aVwxzDHniEw&t=1219s">The beauty of Bézier's Curves</a>". She is amazing, go check her work and <a href="https://www.patreon.com/acegikmo">join her Patreon</a> right away!</p>
<p class="author"><a href="https://www.tiago.wtf/">tiago.wtf</a> | March 2023 | <a href="https://github.com/tiago-kth/visgraf">code</a></p>
</div>
</div>
</div>
<div class="main">
<div class="controls">
<p>The Bézier curve is built as a combination of linear interpolations, controlled by a single parameter <span class="concept">t</span>. You can press <span class="highlight">PLAY</span> to let <span class="concept">t</span> go automatically from 0 to 1 (and then backwards from 1 to 0, and so on), or you can use the <span class="highlight">slider</span> to manually set <span class="concept">t</span>. You can add more control points and move them around.</p>
<div class="play-pause">
<button class="btn-play" data-mode="paused"></button>
<div class="slider-wrapper">
<span class="label">0.00</span>
<input type="range" id="t-control" name="t-control"
min="0" max="1" step="0.01" value="0" list="values">
<!--<label for="t-control">t</label>-->
<datalist id="values">
<option value="0.00" label="0.00"></option>
<option value="0.25" label="0.25"></option>
<option value="0.50" label="0.50"></option>
<option value="0.75" label="0.75"></option>
<option value="1.00" label="1.00"></option>
</datalist>
</div>
</div>
<div class="container-checkbox">
<input type="checkbox" id="ctrl-points" name="points" checked>
<label for="ctrl-points">Show interpolating points</label>
</div>
<div class="container-checkbox">
<input type="checkbox" id="ctrl-segments" name="segments" checked>
<label for="ctrl-segments">Show interpolating segments</label>
</div>
<div class="container-checkbox">
<input type="checkbox" id="ctrl-past-segments" name="past_segments" checked>
<label for="ctrl-past-segments">Keep past segments, <select name="ctrl-past-segments-fade" id="ctrl-past-segments-fade">
<option value="fade">fading them</option>
<option value="no-fade">without fading them</option>
</select></label>
</div>
</div>
<div class="wrapper">
<div class="canvas-container">
<canvas class="the-canvas"></canvas>
</div>
<div class="svg-container">
<svg>
</svg>
</div>
<div class="dialog-new-point">
<p class="passive">Click anywhere to add a new control point!</p>
<div class="yes-no-mode">
<p>Confirm a new point here?</p>
<div class="yes-no-buttons">
<button class="yes">Yes</button>
<button class="no">No</button>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.4/gsap.min.js"></script>
<script src="simplex-noise.js"></script>
<script src="script.js"></script>
<script src="opening.js"></script>
</body>
</html>