particles.app.json 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. {
  2. "camera": {
  3. "metadata": {
  4. "version": 4.3,
  5. "type": "Object",
  6. "generator": "ObjectExporter"
  7. },
  8. "object": {
  9. "uuid": "D722B468-8D40-4CAB-82D6-944D2D5A8D35",
  10. "type": "PerspectiveCamera",
  11. "name": "Camera",
  12. "fov": 50,
  13. "aspect": 1.2237762237762237,
  14. "near": 0.1,
  15. "far": 100000,
  16. "matrix": [0.7071067690849304,-2.468905080377226e-9,-0.7071068286895752,0,-0.2357022613286972,0.9428090453147888,-0.235702246427536,0,0.6666666865348816,0.3333333134651184,0.6666666269302368,0,500,250,500,1]
  17. }
  18. },
  19. "scene": {
  20. "metadata": {
  21. "version": 4.3,
  22. "type": "Object",
  23. "generator": "ObjectExporter"
  24. },
  25. "geometries": [
  26. {
  27. "uuid": "5009F17C-E9D3-4D0E-82A6-2E23159128FB",
  28. "type": "PlaneGeometry",
  29. "width": 600,
  30. "height": 600,
  31. "widthSegments": 1,
  32. "heightSegments": 1
  33. },
  34. {
  35. "uuid": "8693E7B2-0009-4C4C-94C5-8E031557AEC2",
  36. "type": "BoxGeometry",
  37. "width": 4,
  38. "height": 4,
  39. "depth": 4,
  40. "widthSegments": 1,
  41. "heightSegments": 1,
  42. "depthSegments": 1
  43. }],
  44. "materials": [
  45. {
  46. "uuid": "6EDB0369-7E11-4B0F-BF98-4BD761846D65",
  47. "type": "MeshPhongMaterial",
  48. "color": 16777215,
  49. "ambient": 16777215,
  50. "emissive": 0,
  51. "specular": 1118481,
  52. "shininess": 30
  53. },
  54. {
  55. "uuid": "D586E672-03FC-4C82-9D6E-CCCF899DDDB1",
  56. "type": "MeshBasicMaterial",
  57. "color": 16777215
  58. }],
  59. "object": {
  60. "uuid": "3741222A-BD8F-401C-A5D2-5A907E891896",
  61. "type": "Scene",
  62. "name": "Scene",
  63. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],
  64. "children": [
  65. {
  66. "uuid": "05B57416-1BE5-4A96-BB05-9D9CD112D52B",
  67. "type": "Mesh",
  68. "name": "Ground",
  69. "geometry": "5009F17C-E9D3-4D0E-82A6-2E23159128FB",
  70. "material": "6EDB0369-7E11-4B0F-BF98-4BD761846D65",
  71. "matrix": [1,0,0,0,0,0.0007962886593304574,-0.9999997019767761,0,0,0.9999997019767761,0.0007962886593304574,0,0,-2,0,1]
  72. },
  73. {
  74. "uuid": "9DFA44C6-C85A-4F2F-9252-E9564C2785C5",
  75. "type": "Mesh",
  76. "name": "Particle",
  77. "geometry": "8693E7B2-0009-4C4C-94C5-8E031557AEC2",
  78. "material": "D586E672-03FC-4C82-9D6E-CCCF899DDDB1",
  79. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]
  80. },
  81. {
  82. "uuid": "40E5CDA4-0E39-4265-9293-3E9EC3207F61",
  83. "type": "PointLight",
  84. "name": "PointLight",
  85. "color": 16777215,
  86. "intensity": 10,
  87. "distance": 0,
  88. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]
  89. }]
  90. }
  91. },
  92. "scripts": {
  93. "3741222A-BD8F-401C-A5D2-5A907E891896": [
  94. {
  95. "name": "Particle Fountain",
  96. "source": "var original = this.getObjectByName( 'Particle' );\n\nvar particles = [];\n\nfunction update( event ) {\n\n\tif ( particles.length < 200 ) {\n\n\t\tvar velocity = new THREE.Vector3();\n\t\tvelocity.x = Math.random() * 10 - 5;\n\t\tvelocity.y = Math.random() * 10 + 10;\n\t\tvelocity.z = Math.random() * 10 - 5;\n\n\t\tvar particle = original.clone();\n\t\tparticle.userData.velocity = velocity;\n\t\tparticles.push( particle );\n\n\t\tthis.add( particle );\n\n\t}\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.98;\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}"
  97. }]
  98. }
  99. }