-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patheffect.fs
More file actions
73 lines (60 loc) · 2.18 KB
/
effect.fs
File metadata and controls
73 lines (60 loc) · 2.18 KB
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
def createComplete3DShape(
center: org.tabooproject.fluxon.type.TestRuntime$TestLocation,
radius: int,
height: int,
segments: int
) = {
particles = []
// 圆柱体部分
for y in 0..&height {
for angle in 0..&segments {
a = &angle * 2 * 3.14159 / &segments
x = ¢er::x() + &radius * cos(&a)
z = ¢er::z() + &radius * sin(&a)
yPos = ¢er::y() + &y
loc = location(&x, &yPos, &z)
&particles::add(["REDSTONE", &loc]!)
}
}
// 顶部半球形
sphereRadius = &radius
for phi in 0..(&segments/2) {
for theta in 0..&segments {
p = &phi * 3.14159 / (&segments/2)
t = &theta * 2 * 3.14159 / &segments
x = ¢er::x() + &sphereRadius * sin(&p) * cos(&t)
z = ¢er::z() + &sphereRadius * sin(&p) * sin(&t)
y = ¢er::y() + &height + &sphereRadius * cos(&p)
loc = location(&x, &y, &z)
&particles::add(["REDSTONE", &loc]!)
}
}
// 底部左侧球形
leftBallCenter = location(¢er::x() - &radius*0.8, ¢er::y() - &radius*0.8, ¢er::z())
for phi in 0..&segments {
for theta in 0..&segments {
p = &phi * 3.14159 / &segments
t = &theta * 2 * 3.14159 / &segments
x = &leftBallCenter::x() + &radius*0.8 * sin(&p) * cos(&t)
z = &leftBallCenter::z() + &radius*0.8 * sin(&p) * sin(&t)
y = &leftBallCenter::y() + &radius*0.8 * cos(&p)
loc = location(&x, &y, &z)
&particles::add(["REDSTONE", &loc]!)
}
}
// 底部右侧球形
rightBallCenter = location(¢er::x() + &radius*0.8, ¢er::y() - &radius*0.8, ¢er::z())
for phi in 0..&segments {
for theta in 0..&segments {
p = &phi * 3.14159 / &segments
t = &theta * 2 * 3.14159 / &segments
x = &rightBallCenter::x() + &radius*0.8 * sin(&p) * cos(&t)
z = &rightBallCenter::z() + &radius*0.8 * sin(&p) * sin(&t)
y = &rightBallCenter::y() + &radius*0.8 * cos(&p)
loc = location(&x, &y, &z)
&particles::add(["REDSTONE", &loc]!)
}
}
&particles
}
createComplete3DShape(&audience::location(), 2, 6, 20)