1
0

particles.app.json 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. {
  2. "metadata": {
  3. "type": "App"
  4. },
  5. "project": {
  6. "shadows": true,
  7. "vr": false
  8. },
  9. "camera": {
  10. "metadata": {
  11. "version": 4.5,
  12. "type": "Object",
  13. "generator": "Object3D.toJSON"
  14. },
  15. "object": {
  16. "uuid": "056199EB-6985-481B-97CC-A57FB7C87809",
  17. "type": "PerspectiveCamera",
  18. "name": "Camera",
  19. "layers": 1,
  20. "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],
  21. "fov": 50,
  22. "zoom": 1,
  23. "near": 0.1,
  24. "far": 100000,
  25. "focus": 10,
  26. "aspect": 0.666193,
  27. "filmGauge": 35,
  28. "filmOffset": 0
  29. }
  30. },
  31. "scene": {
  32. "metadata": {
  33. "version": 4.5,
  34. "type": "Object",
  35. "generator": "Object3D.toJSON"
  36. },
  37. "geometries": [
  38. {
  39. "uuid": "C3C0CE7D-10B8-43FC-8F74-011CC6E57800",
  40. "type": "PlaneGeometry",
  41. "width": 100,
  42. "height": 100,
  43. "widthSegments": 1,
  44. "heightSegments": 1
  45. }],
  46. "materials": [
  47. {
  48. "uuid": "3A9449D2-62DB-4BB4-ABBD-6F3F9D46DE1A",
  49. "type": "MeshStandardMaterial",
  50. "color": 5465019,
  51. "roughness": 1,
  52. "metalness": 0,
  53. "emissive": 0,
  54. "depthFunc": 3,
  55. "depthTest": true,
  56. "depthWrite": true
  57. },
  58. {
  59. "uuid": "F5361474-F5F1-412F-8D99-3699B868092D",
  60. "type": "SpriteMaterial",
  61. "color": 16777215,
  62. "transparent": true,
  63. "depthFunc": 3,
  64. "depthTest": true,
  65. "depthWrite": true
  66. }],
  67. "object": {
  68. "uuid": "3741222A-BD8F-401C-A5D2-5A907E891896",
  69. "type": "Scene",
  70. "name": "Scene",
  71. "layers": 1,
  72. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],
  73. "children": [
  74. {
  75. "uuid": "05B57416-1BE5-4A96-BB05-9D9CD112D52B",
  76. "type": "Mesh",
  77. "name": "Ground",
  78. "layers": 1,
  79. "matrix": [1,0,0,0,0,0.000796,-1,0,0,1,0.000796,0,0,-0.5,0,1],
  80. "geometry": "C3C0CE7D-10B8-43FC-8F74-011CC6E57800",
  81. "material": "3A9449D2-62DB-4BB4-ABBD-6F3F9D46DE1A"
  82. },
  83. {
  84. "uuid": "0A3CB873-07E6-4EEB-830B-68192504111B",
  85. "type": "Sprite",
  86. "name": "Particle",
  87. "layers": 1,
  88. "matrix": [0.04,0,0,0,0,0.04,0,0,0,0,0.04,0,0,0,0,1],
  89. "material": "F5361474-F5F1-412F-8D99-3699B868092D"
  90. },
  91. {
  92. "uuid": "40E5CDA4-0E39-4265-9293-3E9EC3207F61",
  93. "type": "PointLight",
  94. "name": "PointLight",
  95. "layers": 1,
  96. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,1.183,0,1],
  97. "color": 16777215,
  98. "intensity": 1,
  99. "distance": 0,
  100. "decay": 1,
  101. "shadow": {
  102. "camera": {
  103. "uuid": "B6D3493E-E5C9-4D65-9E26-BB788D127BE1",
  104. "type": "PerspectiveCamera",
  105. "layers": 1,
  106. "fov": 90,
  107. "zoom": 1,
  108. "near": 0.5,
  109. "far": 500,
  110. "focus": 10,
  111. "aspect": 1,
  112. "filmGauge": 35,
  113. "filmOffset": 0
  114. }
  115. }
  116. }],
  117. "background": 2171689,
  118. "fog": {
  119. "type": "Fog",
  120. "color": 2171688,
  121. "near": 1,
  122. "far": 50
  123. }
  124. }
  125. },
  126. "scripts": {
  127. "3741222A-BD8F-401C-A5D2-5A907E891896": [
  128. {
  129. "name": "Fountain",
  130. "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}"
  131. }]
  132. }
  133. }