particles.app.json 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. "emissive": 0,
  50. "specular": 1118481,
  51. "shininess": 30
  52. },
  53. {
  54. "uuid": "F5361474-F5F1-412F-8D99-3699B868092D",
  55. "type": "SpriteMaterial",
  56. "color": 16777215
  57. }],
  58. "object": {
  59. "uuid": "3741222A-BD8F-401C-A5D2-5A907E891896",
  60. "type": "Scene",
  61. "name": "Scene",
  62. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],
  63. "children": [
  64. {
  65. "uuid": "05B57416-1BE5-4A96-BB05-9D9CD112D52B",
  66. "type": "Mesh",
  67. "name": "Ground",
  68. "geometry": "5009F17C-E9D3-4D0E-82A6-2E23159128FB",
  69. "material": "6EDB0369-7E11-4B0F-BF98-4BD761846D65",
  70. "matrix": [1,0,0,0,0,0.0007962886593304574,-0.9999997019767761,0,0,0.9999997019767761,0.0007962886593304574,0,0,-2,0,1]
  71. },
  72. {
  73. "uuid": "0A3CB873-07E6-4EEB-830B-68192504111B",
  74. "type": "Sprite",
  75. "name": "Particle",
  76. "material": "F5361474-F5F1-412F-8D99-3699B868092D",
  77. "matrix": [3,0,0,0,0,3,0,0,0,0,1,0,0,0,0,1]
  78. },
  79. {
  80. "uuid": "40E5CDA4-0E39-4265-9293-3E9EC3207F61",
  81. "type": "PointLight",
  82. "name": "PointLight",
  83. "color": 16777215,
  84. "intensity": 10,
  85. "distance": 0,
  86. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]
  87. }]
  88. }
  89. },
  90. "scripts": {
  91. "3741222A-BD8F-401C-A5D2-5A907E891896": [
  92. {
  93. "name": "Particle Fountain",
  94. "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}"
  95. }]
  96. }
  97. }