-
Notifications
You must be signed in to change notification settings - Fork 52
/
13_random4.html
48 lines (40 loc) · 1.35 KB
/
13_random4.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cindy JS</title>
<script type="text/javascript" src="../../build/js/Cindy.js"></script>
<script type="text/javascript" src="../../build/js/CindyGL.js"></script>
<link rel="stylesheet" href="../../css/cindy.css">
</head>
<body style="font-family:Arial;">
<h1>CindyJS: Random Operator on GPU</h1>
<script id="csinit" type="text/x-cindyscript">
use("CindyGL");
createimage("acc", 512, 512);
colorplot("acc", (0,0,0));
</script>
<script id="csdraw" type="text/x-cindyscript">
colorplot("acc",
current = imagergb("acc", #);
if(|(randomnormal(), randomnormal()) - #|<.2, current+(1,2,3)/10, current)
);
drawimage((-2,-2),(2,-2),"acc");
</script>
<div id="CSCanvas"></div>
<script type="text/javascript">
var gslp=[];
cdy = CindyJS({canvasname:"CSCanvas",
scripts: "cs*",
geometry:gslp,
animation: {autoplay: true},
ports: [{
id: "CSCanvas",
width: 512,
height: 512,
transform: [ { visibleRect: [-2, -2, 2, 2] } ]
}]
});
</script>
</body>
</html>