particles.app.json 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. {
  2. "metadata": {
  3. "type": "App"
  4. },
  5. "project": {
  6. "gammaInput": true,
  7. "gammaOutput": true,
  8. "shadows": true,
  9. "vr": false
  10. },
  11. "camera": {
  12. "metadata": {
  13. "version": 4.5,
  14. "type": "Object",
  15. "generator": "Object3D.toJSON"
  16. },
  17. "object": {
  18. "uuid": "056199EB-6985-481B-97CC-A57FB7C87809",
  19. "type": "PerspectiveCamera",
  20. "name": "Camera",
  21. "layers": 1,
  22. "matrix": [0.707107,0,-0.707107,0,-0.235702,0.942809,-0.235702,0,0.666667,0.333333,0.666667,0,4.182,2.091,4.182,1],
  23. "fov": 50,
  24. "zoom": 1,
  25. "near": 0.1,
  26. "far": 100000,
  27. "focus": 10,
  28. "aspect": 0.666193,
  29. "filmGauge": 35,
  30. "filmOffset": 0
  31. }
  32. },
  33. "scene": {
  34. "metadata": {
  35. "version": 4.5,
  36. "type": "Object",
  37. "generator": "Object3D.toJSON"
  38. },
  39. "geometries": [
  40. {
  41. "uuid": "C3C0CE7D-10B8-43FC-8F74-011CC6E57800",
  42. "type": "PlaneBufferGeometry",
  43. "width": 100,
  44. "height": 100,
  45. "widthSegments": 1,
  46. "heightSegments": 1
  47. }],
  48. "materials": [
  49. {
  50. "uuid": "3A9449D2-62DB-4BB4-ABBD-6F3F9D46DE1A",
  51. "type": "MeshStandardMaterial",
  52. "color": 5465019,
  53. "roughness": 1,
  54. "metalness": 0,
  55. "emissive": 0,
  56. "depthFunc": 3,
  57. "depthTest": true,
  58. "depthWrite": true
  59. },
  60. {
  61. "uuid": "F5361474-F5F1-412F-8D99-3699B868092D",
  62. "type": "SpriteMaterial",
  63. "color": 16777215,
  64. "transparent": true,
  65. "depthFunc": 3,
  66. "depthTest": true,
  67. "depthWrite": true
  68. }],
  69. "object": {
  70. "uuid": "3741222A-BD8F-401C-A5D2-5A907E891896",
  71. "type": "Scene",
  72. "name": "Scene",
  73. "layers": 1,
  74. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],
  75. "children": [
  76. {
  77. "uuid": "05B57416-1BE5-4A96-BB05-9D9CD112D52B",
  78. "type": "Mesh",
  79. "name": "Ground",
  80. "layers": 1,
  81. "matrix": [1,0,0,0,0,0.000796,-1,0,0,1,0.000796,0,0,-0.5,0,1],
  82. "geometry": "C3C0CE7D-10B8-43FC-8F74-011CC6E57800",
  83. "material": "3A9449D2-62DB-4BB4-ABBD-6F3F9D46DE1A"
  84. },
  85. {
  86. "uuid": "0A3CB873-07E6-4EEB-830B-68192504111B",
  87. "type": "Sprite",
  88. "name": "Particle",
  89. "layers": 1,
  90. "matrix": [0.04,0,0,0,0,0.04,0,0,0,0,0.04,0,0,0,0,1],
  91. "material": "F5361474-F5F1-412F-8D99-3699B868092D"
  92. },
  93. {
  94. "uuid": "40E5CDA4-0E39-4265-9293-3E9EC3207F61",
  95. "type": "PointLight",
  96. "name": "PointLight",
  97. "layers": 1,
  98. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,1.183,0,1],
  99. "color": 16777215,
  100. "intensity": 1,
  101. "distance": 0,
  102. "decay": 1,
  103. "shadow": {
  104. "camera": {
  105. "uuid": "B6D3493E-E5C9-4D65-9E26-BB788D127BE1",
  106. "type": "PerspectiveCamera",
  107. "layers": 1,
  108. "fov": 90,
  109. "zoom": 1,
  110. "near": 0.5,
  111. "far": 500,
  112. "focus": 10,
  113. "aspect": 1,
  114. "filmGauge": 35,
  115. "filmOffset": 0
  116. }
  117. }
  118. }],
  119. "background": 2171689,
  120. "fog": {
  121. "type": "Fog",
  122. "color": 2171688,
  123. "near": 1,
  124. "far": 50
  125. }
  126. }
  127. },
  128. "scripts": {
  129. "3741222A-BD8F-401C-A5D2-5A907E891896": [
  130. {
  131. "name": "Fountain",
  132. "source": "var original = this.getObjectByName( 'Particle' );\n\nvar particles = [];\n\nfor ( var i = 0; i < 100; i ++ ) {\n\n\tvar particle = original.clone();\n\tparticle.userData.velocity = new THREE.Vector3();\n\tthis.add( particle );\n\n\tparticles.push( particle );\n\n}\n\nfunction update( event ) {\n\t\n\tvar particle = particles.shift();\n\tparticles.push( particle );\n\t\t\n\tvar velocity = particle.userData.velocity;\n\tvelocity.x = Math.random() * 0.1 - 0.05;\n\tvelocity.y = Math.random() * 0.1 + 0.1;\n\tvelocity.z = Math.random() * 0.1 - 0.05;\n\n\tfor ( var i = 0; i < particles.length; i ++ ) {\n\n\t\tvar particle = particles[ i ];\n\n\t\tvar velocity = particle.userData.velocity;\n\n\t\tvelocity.y -= 0.0098;\n\n\t\tparticle.position.add( velocity );\n\n\t\tif ( particle.position.y < 0 ) {\n\n\t\t\tparticle.position.y = 0;\n\n\t\t\tvelocity.y = - velocity.y;\n\t\t\tvelocity.multiplyScalar( 0.6 );\n\n\t\t}\n\n\t}\n\n}"
  133. }]
  134. }
  135. }