app.json 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. {
  2. "metadata": {
  3. "type": "App"
  4. },
  5. "project": {
  6. "shadows": true,
  7. "shadowType": 1,
  8. "toneMapping": 0,
  9. "toneMappingExposure": 1
  10. },
  11. "camera": {
  12. "metadata": {
  13. "version": 4.6,
  14. "type": "Object",
  15. "generator": "Object3D.toJSON"
  16. },
  17. "object": {
  18. "uuid": "4AC7ADED-CC22-4B16-8218-2E0A0C38C8F8",
  19. "type": "PerspectiveCamera",
  20. "name": "Camera",
  21. "layers": 1,
  22. "matrix": [0.9893305701573376,1.3877788257371508e-17,0.14568832396646428,0,0.08776497083444448,0.7981820063610147,-0.5959885203667386,0,-0.11628578201502236,0.6024159075898443,0.789665745956388,0,-3.3458904793515534,5.969381391686978,10.547197958262647,1],
  23. "up": [0,1,0],
  24. "fov": 50,
  25. "zoom": 1,
  26. "near": 0.1,
  27. "far": 100000,
  28. "focus": 10,
  29. "aspect": 1.7647058823529411,
  30. "filmGauge": 35,
  31. "filmOffset": 0
  32. }
  33. },
  34. "scene": {
  35. "metadata": {
  36. "version": 4.6,
  37. "type": "Object",
  38. "generator": "Object3D.toJSON"
  39. },
  40. "geometries": [
  41. {
  42. "uuid": "490CEBA3-6A25-4BE1-B517-C5FB11A5D18A",
  43. "type": "PlaneGeometry",
  44. "width": 6,
  45. "height": 4,
  46. "widthSegments": 1,
  47. "heightSegments": 1
  48. },
  49. {
  50. "uuid": "D9A92F2D-2F08-4851-99C7-12D8D1CA13C7",
  51. "type": "BoxGeometry",
  52. "width": 0.1,
  53. "height": 0.1,
  54. "depth": 0.1,
  55. "widthSegments": 1,
  56. "heightSegments": 1,
  57. "depthSegments": 1
  58. },
  59. {
  60. "uuid": "5E63B8CF-E225-4ABC-994A-4D06BD4E21EB",
  61. "type": "BoxGeometry",
  62. "width": 0.2,
  63. "height": 0.2,
  64. "depth": 1,
  65. "widthSegments": 1,
  66. "heightSegments": 1,
  67. "depthSegments": 1
  68. },
  69. {
  70. "uuid": "D61532B4-24C3-4BC4-B56B-7245E8163E09",
  71. "type": "BoxGeometry",
  72. "width": 0.2,
  73. "height": 0.2,
  74. "depth": 1,
  75. "widthSegments": 1,
  76. "heightSegments": 1,
  77. "depthSegments": 1
  78. }],
  79. "materials": [
  80. {
  81. "uuid": "7EDF7C08-6325-418A-BBAB-89341C694730",
  82. "type": "MeshPhongMaterial",
  83. "color": 16777215,
  84. "emissive": 0,
  85. "specular": 16777215,
  86. "shininess": 30,
  87. "envMapRotation": [0,0,0,
  88. "XYZ"],
  89. "reflectivity": 1,
  90. "refractionRatio": 0.98,
  91. "blendColor": 0
  92. },
  93. {
  94. "uuid": "B1CAF098-FE36-45E1-BEBE-8D6AC04821CC",
  95. "type": "MeshPhongMaterial",
  96. "color": 16711680,
  97. "emissive": 0,
  98. "specular": 1118481,
  99. "shininess": 30,
  100. "envMapRotation": [0,0,0,
  101. "XYZ"],
  102. "reflectivity": 1,
  103. "refractionRatio": 0.98,
  104. "blendColor": 0
  105. },
  106. {
  107. "uuid": "FBDBE66D-B613-4741-802D-5AE1DE07DE46",
  108. "type": "MeshPhongMaterial",
  109. "color": 2752767,
  110. "emissive": 0,
  111. "specular": 1118481,
  112. "shininess": 30,
  113. "envMapRotation": [0,0,0,
  114. "XYZ"],
  115. "reflectivity": 1,
  116. "refractionRatio": 0.98,
  117. "blendColor": 0
  118. }],
  119. "object": {
  120. "uuid": "31517222-A9A7-4EAF-B5F6-60751C0BABA3",
  121. "type": "Scene",
  122. "name": "Scene",
  123. "layers": 1,
  124. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],
  125. "up": [0,1,0],
  126. "background": 11184810,
  127. "children": [
  128. {
  129. "uuid": "B47D0BFC-D63A-4CBB-985E-9C4DBDF086E4",
  130. "type": "Mesh",
  131. "name": "Ground",
  132. "layers": 1,
  133. "matrix": [1,0,0,0,0,0.0007959999999995675,-1,0,0,1,0.0007959999999995675,0,0,-0.1,0,1],
  134. "up": [0,1,0],
  135. "geometry": "490CEBA3-6A25-4BE1-B517-C5FB11A5D18A",
  136. "material": "7EDF7C08-6325-418A-BBAB-89341C694730"
  137. },
  138. {
  139. "uuid": "CE13E58A-4E8B-4F72-9E2E-7DE57C58F989",
  140. "type": "Mesh",
  141. "name": "Ball",
  142. "layers": 1,
  143. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],
  144. "up": [0,1,0],
  145. "geometry": "D9A92F2D-2F08-4851-99C7-12D8D1CA13C7",
  146. "material": "B1CAF098-FE36-45E1-BEBE-8D6AC04821CC"
  147. },
  148. {
  149. "uuid": "2AAEA3AA-EC45-492B-B450-10473D1EC6C5",
  150. "type": "Mesh",
  151. "name": "Pad 1",
  152. "layers": 1,
  153. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,-2.4,0,0,1],
  154. "up": [0,1,0],
  155. "geometry": "5E63B8CF-E225-4ABC-994A-4D06BD4E21EB",
  156. "material": "FBDBE66D-B613-4741-802D-5AE1DE07DE46"
  157. },
  158. {
  159. "uuid": "F1DD46A7-6584-4A37-BC76-852C3911077E",
  160. "type": "Mesh",
  161. "name": "Pad 2",
  162. "layers": 1,
  163. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,2.4,0,0,1],
  164. "up": [0,1,0],
  165. "geometry": "D61532B4-24C3-4BC4-B56B-7245E8163E09",
  166. "material": "FBDBE66D-B613-4741-802D-5AE1DE07DE46"
  167. },
  168. {
  169. "uuid": "C62AAE9F-9E51-46A5-BD2B-71BA804FC0B3",
  170. "type": "DirectionalLight",
  171. "name": "DirectionalLight",
  172. "layers": 1,
  173. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,1,2,1.5,1],
  174. "up": [0,1,0],
  175. "color": 16777215,
  176. "intensity": 1,
  177. "shadow": {
  178. "camera": {
  179. "uuid": "2CF1F42A-8992-4E8D-8D94-7CC20979344C",
  180. "type": "OrthographicCamera",
  181. "layers": 1,
  182. "up": [0,1,0],
  183. "zoom": 1,
  184. "left": -5,
  185. "right": 5,
  186. "top": 5,
  187. "bottom": -5,
  188. "near": 0.5,
  189. "far": 500
  190. }
  191. },
  192. "target": "85b05b53-6c4b-413d-976c-6e628f4abc18"
  193. }],
  194. "backgroundRotation": [0,0,0,
  195. "XYZ"],
  196. "environmentRotation": [0,0,0,
  197. "XYZ"]
  198. }
  199. },
  200. "scripts": {
  201. "31517222-A9A7-4EAF-B5F6-60751C0BABA3": [
  202. {
  203. "name": "Game logic",
  204. "source": "var ball = this.getObjectByName( 'Ball' );\n\nvar position = ball.position;\n\nvar velocity = new THREE.Vector3();\n\nvar direction = new THREE.Vector3();\ndirection.x = Math.random() - 0.5;\ndirection.z = Math.random() - 0.5;\ndirection.normalize().multiplyScalar( 0.1 );\n\nvar pad1 = this.getObjectByName( 'Pad 1' );\nvar pad2 = this.getObjectByName( 'Pad 2' );\n\nvar raycaster = new THREE.Raycaster();\nvar objects = [ pad1, pad2 ];\n\n//\n\nfunction pointermove( event ) {\n\n\tpad1.position.z = ( event.clientX / player.width ) * 3 - 1.5;\n\tpad2.position.z = - pad1.position.z;\n\n}\n\nfunction update( event ) {\n\t\n\tif ( position.x < -3 || position.x > 3 ) direction.x = - direction.x;\n\tif ( position.z < -2 || position.z > 2 ) direction.z = - direction.z;\n\t\n\tposition.x = Math.max( - 3, Math.min( 3, position.x ) );\n\tposition.z = Math.max( - 2, Math.min( 2, position.z ) );\n\t\n\traycaster.set( position, direction );\n\t\n\tvar intersections = raycaster.intersectObjects( objects );\n\t\n\tif ( intersections.length > 0 ) {\n\n\t\tvar intersection = intersections[ 0 ];\n\t\t\n\t\tif ( intersection.distance < 0.1 ) {\n\t\t\t\n\t\t\tdirection.reflect( intersection.face.normal );\n\t\t\t\n\t\t}\n\t\t\n\t}\n\n\tposition.add( velocity.copy( direction ).multiplyScalar( event.delta / 20 ) );\n\n}"
  205. }]
  206. },
  207. "environment": null
  208. }