| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- {
- "metadata": {
- "type": "App"
- },
- "project": {
- "shadows": true,
- "shadowType": 1,
- "toneMapping": 0,
- "toneMappingExposure": 1
- },
- "camera": {
- "metadata": {
- "version": 4.6,
- "type": "Object",
- "generator": "Object3D.toJSON"
- },
- "object": {
- "uuid": "4AC7ADED-CC22-4B16-8218-2E0A0C38C8F8",
- "type": "PerspectiveCamera",
- "name": "Camera",
- "layers": 1,
- "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],
- "up": [0,1,0],
- "fov": 50,
- "zoom": 1,
- "near": 0.1,
- "far": 100000,
- "focus": 10,
- "aspect": 1.7647058823529411,
- "filmGauge": 35,
- "filmOffset": 0
- }
- },
- "scene": {
- "metadata": {
- "version": 4.6,
- "type": "Object",
- "generator": "Object3D.toJSON"
- },
- "geometries": [
- {
- "uuid": "490CEBA3-6A25-4BE1-B517-C5FB11A5D18A",
- "type": "PlaneGeometry",
- "width": 6,
- "height": 4,
- "widthSegments": 1,
- "heightSegments": 1
- },
- {
- "uuid": "D9A92F2D-2F08-4851-99C7-12D8D1CA13C7",
- "type": "BoxGeometry",
- "width": 0.1,
- "height": 0.1,
- "depth": 0.1,
- "widthSegments": 1,
- "heightSegments": 1,
- "depthSegments": 1
- },
- {
- "uuid": "5E63B8CF-E225-4ABC-994A-4D06BD4E21EB",
- "type": "BoxGeometry",
- "width": 0.2,
- "height": 0.2,
- "depth": 1,
- "widthSegments": 1,
- "heightSegments": 1,
- "depthSegments": 1
- },
- {
- "uuid": "D61532B4-24C3-4BC4-B56B-7245E8163E09",
- "type": "BoxGeometry",
- "width": 0.2,
- "height": 0.2,
- "depth": 1,
- "widthSegments": 1,
- "heightSegments": 1,
- "depthSegments": 1
- }],
- "materials": [
- {
- "uuid": "7EDF7C08-6325-418A-BBAB-89341C694730",
- "type": "MeshPhongMaterial",
- "color": 16777215,
- "emissive": 0,
- "specular": 16777215,
- "shininess": 30,
- "envMapRotation": [0,0,0,
- "XYZ"],
- "reflectivity": 1,
- "refractionRatio": 0.98,
- "blendColor": 0
- },
- {
- "uuid": "B1CAF098-FE36-45E1-BEBE-8D6AC04821CC",
- "type": "MeshPhongMaterial",
- "color": 16711680,
- "emissive": 0,
- "specular": 1118481,
- "shininess": 30,
- "envMapRotation": [0,0,0,
- "XYZ"],
- "reflectivity": 1,
- "refractionRatio": 0.98,
- "blendColor": 0
- },
- {
- "uuid": "FBDBE66D-B613-4741-802D-5AE1DE07DE46",
- "type": "MeshPhongMaterial",
- "color": 2752767,
- "emissive": 0,
- "specular": 1118481,
- "shininess": 30,
- "envMapRotation": [0,0,0,
- "XYZ"],
- "reflectivity": 1,
- "refractionRatio": 0.98,
- "blendColor": 0
- }],
- "object": {
- "uuid": "31517222-A9A7-4EAF-B5F6-60751C0BABA3",
- "type": "Scene",
- "name": "Scene",
- "layers": 1,
- "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],
- "up": [0,1,0],
- "background": 11184810,
- "children": [
- {
- "uuid": "B47D0BFC-D63A-4CBB-985E-9C4DBDF086E4",
- "type": "Mesh",
- "name": "Ground",
- "layers": 1,
- "matrix": [1,0,0,0,0,0.0007959999999995675,-1,0,0,1,0.0007959999999995675,0,0,-0.1,0,1],
- "up": [0,1,0],
- "geometry": "490CEBA3-6A25-4BE1-B517-C5FB11A5D18A",
- "material": "7EDF7C08-6325-418A-BBAB-89341C694730"
- },
- {
- "uuid": "CE13E58A-4E8B-4F72-9E2E-7DE57C58F989",
- "type": "Mesh",
- "name": "Ball",
- "layers": 1,
- "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],
- "up": [0,1,0],
- "geometry": "D9A92F2D-2F08-4851-99C7-12D8D1CA13C7",
- "material": "B1CAF098-FE36-45E1-BEBE-8D6AC04821CC"
- },
- {
- "uuid": "2AAEA3AA-EC45-492B-B450-10473D1EC6C5",
- "type": "Mesh",
- "name": "Pad 1",
- "layers": 1,
- "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,-2.4,0,0,1],
- "up": [0,1,0],
- "geometry": "5E63B8CF-E225-4ABC-994A-4D06BD4E21EB",
- "material": "FBDBE66D-B613-4741-802D-5AE1DE07DE46"
- },
- {
- "uuid": "F1DD46A7-6584-4A37-BC76-852C3911077E",
- "type": "Mesh",
- "name": "Pad 2",
- "layers": 1,
- "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,2.4,0,0,1],
- "up": [0,1,0],
- "geometry": "D61532B4-24C3-4BC4-B56B-7245E8163E09",
- "material": "FBDBE66D-B613-4741-802D-5AE1DE07DE46"
- },
- {
- "uuid": "C62AAE9F-9E51-46A5-BD2B-71BA804FC0B3",
- "type": "DirectionalLight",
- "name": "DirectionalLight",
- "layers": 1,
- "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,1,2,1.5,1],
- "up": [0,1,0],
- "color": 16777215,
- "intensity": 1,
- "shadow": {
- "camera": {
- "uuid": "2CF1F42A-8992-4E8D-8D94-7CC20979344C",
- "type": "OrthographicCamera",
- "layers": 1,
- "up": [0,1,0],
- "zoom": 1,
- "left": -5,
- "right": 5,
- "top": 5,
- "bottom": -5,
- "near": 0.5,
- "far": 500
- }
- },
- "target": "85b05b53-6c4b-413d-976c-6e628f4abc18"
- }],
- "backgroundRotation": [0,0,0,
- "XYZ"],
- "environmentRotation": [0,0,0,
- "XYZ"]
- }
- },
- "scripts": {
- "31517222-A9A7-4EAF-B5F6-60751C0BABA3": [
- {
- "name": "Game logic",
- "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}"
- }]
- },
- "environment": null
- }
|