forked from stemkoski/A-Frame-Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
particles.html
135 lines (125 loc) · 3.82 KB
/
particles.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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<html>
<head>
<script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
<!-- <script src="js/aframe-master.1.0.4.min.js"></script> -->
<script src="js/aframe-environment-component.js"></script>
<script src="js/aframe-spe-particles-component.js"></script>
<script src="js/extended-wasd-controls.js"></script>
</head>
<body>
<a-scene environment="preset: starry; fog: 0;" keyboard-shortcuts="enterVR: false;" >
<!-- adding in look controls -->
<a-entity id="camera" camera look-controls
position="0 1.6 0"
extended-wasd-controls="flyEnabled: true; turnEnabled: false; lookEnabled: false;
maxLookEnabled: false; coordinateLookControls: true;">
</a-entity>
<!-- water fountain -->
<a-cylinder position="-3 2 -4" radius="0.1" height="0.1" color="gray">
<a-entity
spe-particles="
texture: images/particles/snowflake.png;
color: #0000FF, #00FFFF, #FFFFFF;
opacity: 1, 1, 0;
size: 1, 1, 0;
velocity: 0 4 0;
velocity-spread: 2 0 2;
acceleration: 0 -6 0;
particle-count: 1000;">
</a-entity>
</a-cylinder>
<!-- sparkle-ball -->
<a-sphere
radius = "0.1"
position = "-1 2 -4"
color = "#FF8800">
<a-entity
spe-particles="
texture: images/particles/sparkle.png;
color: #FFFF00, #FF0000;
size: 1, 0;
distribution: SPHERE;
radius: 0.001;
velocity: 0.2;
velocity-spread: 0.1;
angle: 0, 6.28;
particle-count: 1000;
blending: additive;
maxAge: 3; ">
</a-entity>
</a-sphere>
<!-- star fountain -->
<a-entity position="0 2 -4"
spe-particles="
texture: images/particles/star.png;
color: #FF0000, #FFFF00, #00FFFF, #FF00FF;
distribution: BOX;
opacity: 1,1,1,0;
velocity: 0 0.5 0;
velocity-spread: 0.2 0 0.2;
blending: normal;
particle-count: 100;
angle: 0, 6.28;
maxAge: 3; ">
</a-entity>
<!-- firework -- set active-multiplier to a large number
and also set duration < max-age for a single burst -->
<a-entity position="3 4 -8"
spe-particles="
texture: images/particles/sparkle.png;
color: yellow, red, cyan, black;
distribution: sphere;
randomize-velocity: true;
radius: 0.01;
particle-count: 800;
velocity: 1;
velocity-spread: 0.5;
drag: 1;
max-age: 2;
blending: additive;
active-multiplier: 1000;
size: 1, 1, 1, 0">
</a-entity>
<!-- clouds -->
<a-entity position="-1.5 3.5 -4" spe-particles="
texture: images/particles/fog-256.png;
position-spread: 1 0.2 0.5;
velocity-spread: 0.1 0.05 0.1;
particle-count: 200;
max-age: 10;
size: 6, 10;
opacity: 0, 1, 0;
angle: 0;
angle-spread: 6.28;
randomize-position: true;">
</a-entity>
<!-- color ball -->
<a-entity position="1 2 -4"
spe-particles="
texture: images/particles/circle.png;
particle-count: 400;
max-age: 3;
distribution: sphere;
radius: 0.2;
color: #FF0000, #0000FF;
color-spread: 1 0 0, 0 0 1;
size: 0, 1, 0">
</a-entity>
<!-- fire ball -->
<a-entity position="2 2 -4"
spe-particles="
texture: images/particles/snowflake.png;
particle-count: 200;
max-age: 3;
blending: additive;
distribution: sphere;
velocity: 0.04;
velocity-spread: 0.03;
radius: 0.01;
color: #FF4400, #FF1100, #FF0000, #880000;
opacity: 0.1;
size: 3, 3, 3, 0">
</a-entity>
</a-scene>
</body>
</html>