-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
executable file
·71 lines (59 loc) · 1.4 KB
/
main.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
function draw() { // hier kommen befehle rein
//CS.disableDepth();
CS.drawSquares();
CS.drawAxes();
CS.labelAxes();
/*CS.drawVector(
new Vector3(1, 2, 0),
new Vector3(0, 0, 0),
{color: Color.Orange, label: 'Vektor v2'}
);*/
/*CS.drawRectangle(
new Vector3(0, 0, 0),
new Vector2(1, 1)
);*/
CS.drawCircle(
new Vector3(0, -3, 0),
1,
{ color: Color.Orange }
);
CS.drawCuboid(
new Vector3(0, 0, 0),
new Vector3(1, 1, 1),
{ color: Color.Orange }
);
CS.drawTetrahedon(
new Vector3(4, 0, 0),
2,
4,
{ color: Color.Orange }
);
CS.drawFunction(function (x) {
return Math.sin(x) + Math.pow(x, 2) * 0.01;
});
/*CS.drawFunction2d(function(x, z) {
//return Math.sin(x) + Math.sin(z);
return 0.5*Math.sin(6.28*(x+2*z)/6)+Math.cos(6.28*(x+z)/6)+0.5*Math.sin(6.28*(2*x+z)/6);
});*/
/*CS.drawPolygon(
new Vector3(0, 0, 0),
2,
5
);*/
}
/*var polyCount = 1;
var drawAnimation = true;
function draw() { // hier kommen befehle rein
CS.clearScreen();
CS.drawSquares();
CS.drawAxes();
CS.labelAxes();
polyCount += 0.01;
CS.drawPolygon(
new Vector3(0, 0, 0),
3,
polyCount
);
if (drawAnimation)
window.requestAnimationFrame(draw);
}*/