particles.app.json 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. {
  2. "metadata": {
  3. "type": "App"
  4. },
  5. "project": {
  6. "shadows": true,
  7. "editable": true,
  8. "vr": false
  9. },
  10. "camera": {
  11. "metadata": {
  12. "version": 4.4,
  13. "type": "Object",
  14. "generator": "Object3D.toJSON"
  15. },
  16. "object": {
  17. "uuid": "763F3000-7D7C-4BE6-80B6-914DEEBD9AA2",
  18. "type": "PerspectiveCamera",
  19. "name": "Camera",
  20. "matrix": [0.7071067690849304,-3.398992198810902e-11,-0.7071068286895752,0,-0.2357022613286972,0.9428090453147888,-0.235702246427536,0,0.6666666865348816,0.3333333134651184,0.6666666269302368,0,41.824005126953125,20.912002563476562,41.824005126953125,1],
  21. "fov": 50,
  22. "zoom": 1,
  23. "near": 0.1,
  24. "far": 100000,
  25. "focus": 10,
  26. "aspect": 0.46657381615598886,
  27. "filmGauge": 35,
  28. "filmOffset": 0
  29. }
  30. },
  31. "scene": {
  32. "metadata": {
  33. "version": 4.4,
  34. "type": "Object",
  35. "generator": "Object3D.toJSON"
  36. },
  37. "geometries": [
  38. {
  39. "uuid": "E80D9EC5-D722-4812-8226-5F355EAC9B96",
  40. "type": "PlaneGeometry",
  41. "width": 1000,
  42. "height": 1000,
  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. },
  55. {
  56. "uuid": "F5361474-F5F1-412F-8D99-3699B868092D",
  57. "type": "SpriteMaterial",
  58. "color": 16777215
  59. }],
  60. "object": {
  61. "uuid": "3741222A-BD8F-401C-A5D2-5A907E891896",
  62. "type": "Scene",
  63. "name": "Scene",
  64. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],
  65. "children": [
  66. {
  67. "uuid": "05B57416-1BE5-4A96-BB05-9D9CD112D52B",
  68. "type": "Mesh",
  69. "name": "Ground",
  70. "matrix": [1,0,0,0,0,0.0007959486683830619,-0.9999997019767761,0,0,0.9999997019767761,0.0007959486683830619,0,0,-0.5,0,1],
  71. "geometry": "E80D9EC5-D722-4812-8226-5F355EAC9B96",
  72. "material": "3A9449D2-62DB-4BB4-ABBD-6F3F9D46DE1A"
  73. },
  74. {
  75. "uuid": "0A3CB873-07E6-4EEB-830B-68192504111B",
  76. "type": "Sprite",
  77. "name": "Particle",
  78. "matrix": [0.4000000059604645,0,0,0,0,0.4000000059604645,0,0,0,0,0.4000000059604645,0,0,0,0,1],
  79. "material": "F5361474-F5F1-412F-8D99-3699B868092D"
  80. },
  81. {
  82. "uuid": "40E5CDA4-0E39-4265-9293-3E9EC3207F61",
  83. "type": "PointLight",
  84. "name": "PointLight",
  85. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,11.828879356384277,0,1],
  86. "color": 16777215,
  87. "intensity": 1,
  88. "distance": 0,
  89. "decay": 1
  90. }]
  91. }
  92. },
  93. "scripts": {
  94. "3741222A-BD8F-401C-A5D2-5A907E891896": [
  95. {
  96. "name": "Fountain",
  97. "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.5;\n\tvelocity.y = Math.random() + 1;\n\tvelocity.z = Math.random() - 0.5;\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.098;\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}"
  98. }]
  99. }
  100. }