forked from dlecocq/webglot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscalar_field.html
40 lines (36 loc) · 1001 Bytes
/
scalar_field.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
<!DOCTYPE html>
<html>
<head>
<title>WebGLot Alpha</title>
<script src="primitive.js"> </script>
<script src="stopwatch.js"> </script>
<script src="curve.js"> </script>
<script src="p_curve.js"> </script>
<script src="scalar_field.js"> </script>
<script src="CanvasMatrix.js"> </script>
<script src="screen.js"> </script>
<script src="grapher.js"> </script>
<script>
function start() {
var glot = new grapher();
glot.initialize();
glot.add(new scalar_field(glot.getContext(), "sin(3.0 * sqrt(x * x + y * y) - 2.0 * t) * cos(5.0 * sqrt((x - 1.5) * (x - 1.5) + (y - 0.75) * (y - 0.75)) - t)"));
var f = function() { glot.reshape(); glot.display() };
setInterval(f, 10);
}
</script>
<style type="text/css">
canvas {
border: 1px solid black;
width:100%;
height:400px;
}
</style>
</head>
<body onload="start()">
<canvas id="glot">
There is supposed to be an example drawing here, but it's not important.
</canvas>
<div id="framerate">15</div>
</body>
</html>