-
Notifications
You must be signed in to change notification settings - Fork 0
/
extras.js
74 lines (60 loc) · 1.08 KB
/
extras.js
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
var scaler = {};
scaler.alter = function(element)
{
objectScale = parseInt(element.value);
new Audio("snap.m4a").play();
perlinGrid();
setupTriangleStrips();
calculateFrustrum(0, "")
draw();
};
var octaver = {};
octaver.alter = function(element)
{
octave = parseInt(element.value);
maxFrequency =Math.pow(2, octave);
//new Audio("snap.m4a").play();
perlinGrid();
draw();
};
var contrast = {};
contrast.alter = function(element)
{
mag = element.value;
perlinGrid();
setupTriangleStrips();
calculateFrustrum(0, "");
draw();
};
var angler = {};
angler.alter = function(element)
{
myAngle = parseInt(element.value);
// new Audio("short-click.wav").play();
changeVectorAngles(myAngle);
perlinGrid();
setupTriangleStrips();
calculateFrustrum(0, "");
draw();
};
function Create2DArray(size)
{
var arr = [];
for (var i=0;i<size;i++)
{
arr[i] = [];
}
return arr;
}
function Create3DArray(gridWidth)
{
var arr = Create2DArray(gridWidth);
for (var j=0;j<gridWidth;j++)
{
for (var i=0;i<gridWidth;i++)
{
arr[i][j] = [];
}
}
return arr;
}