-
Notifications
You must be signed in to change notification settings - Fork 2
/
Functions.clu
102 lines (83 loc) · 1.32 KB
/
Functions.clu
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
DefVarsN3();
:IPNS;
Cylinder=
{
a = _P(1);
b = _P(2);
r = _P(3);
ae=(a^(e^e0))*(e^e0);
be=(b^(e^e0))*(e^e0);
d=(be-ae);
dc = d+((0.5*d^^2)*e)+e0;
:Color(0.4, 0.4,0.4);
DrawCylinder(a,dc,r,72,true);
}
Sphere =
{
point = _P(1);
r = _P(2);
:Yellow;
:sphere = point - 1/2*r^^2*einf;
}
Feet =
{
c = _P(1);
h = _P(2);
w = _P(3);
d = _P(4);
ce = (c^(e^e0))*(e^e0);
he = (h^(e^e0))*(e^e0);
we = (w^(e^e0))*(e^e0);
de = (d^(e^e0))*(e^e0);
x = 2*(he-ce);
y = 2 * (we-ce);
z = 2 * (de - ce);
hi = x + ((0.5*x^^2)*e) + e0;
wi = y + ((0.5*y^^2)*e) + e0;
di = z + ((0.5*z^^2)*e) + e0;
:Color(0.4, 0.4,0.4);
DrawBox(c, hi, wi, di);
}
Eye =
{
a = _P(1);
b = _P(2);
r = _P(3);
ae=(a^(e^e0))*(e^e0);
be=(b^(e^e0))*(e^e0);
d=(be-ae);
dc = d+((0.5*d^^2)*e)+e0;
:Yellow;
DrawCylinder(a,dc,r,72,false);
}
Nose =
{
a = _P(1);
b = _P(2);
r = _P(3);
ae=(a^(e^e0))*(e^e0);
be=(b^(e^e0))*(e^e0);
d=(be-ae);
dc = d+((0.5*d^^2)*e)+e0;
:Color(0.4, 0.4,0.4);
DrawCone(a,dc,r);
}
Floor =
{
c = _P(1);
h = _P(2);
w = _P(3);
d = _P(4);
ce = (c^(e^e0))*(e^e0);
he = (h^(e^e0))*(e^e0);
we = (w^(e^e0))*(e^e0);
de = (d^(e^e0))*(e^e0);
x = 2*(he-ce);
y = 2 * (we-ce);
z = 2 * (de - ce);
hi = x + ((0.5*x^^2)*e) + e0;
wi = y + ((0.5*y^^2)*e) + e0;
di = z + ((0.5*z^^2)*e) + e0;
:Color(0.55, 0.65,0.32);
DrawBox(c, hi, wi, di);
}