11{
2+ "project" : {
3+ "vr" : false
4+ },
25 "camera" : {
36 "metadata" : {
4- "version" : 4.3 ,
7+ "version" : 4.4 ,
58 "type" : " Object" ,
6- "generator" : " ObjectExporter "
9+ "generator" : " Object3D.toJSON "
710 },
811 "object" : {
9- "uuid" : " 8EFB9C06-6312-4975-B04A-C9E4549BE348 " ,
12+ "uuid" : " E41E9F54-8B31-4D1F-8D09-AF5E802E9A22 " ,
1013 "type" : " PerspectiveCamera" ,
1114 "name" : " Camera" ,
15+ "matrix" : [0.9392361044883728 ,-2.8092810300250903e-9 ,-0.3432718515396118 ,0 ,-0.14778217673301697 ,0.902585506439209 ,-0.404351145029068 ,0 ,0.3098321855068207 ,0.43051064014434814 ,0.847740888595581 ,0 ,142.32125854492188 ,202.75485229492188 ,389.40936279296875 ,1 ],
1216 "fov" : 50 ,
1317 "aspect" : 1.536388140161725 ,
1418 "near" : 0.1 ,
15- "far" : 100000 ,
16- "matrix" : [0.9392361044883728 ,-1.2050817232989175e-8 ,-0.34327182173728943 ,0 ,-0.15080472826957703 ,0.8983326554298401 ,-0.41262128949165344 ,0 ,0.30837228894233704 ,0.4393158257007599 ,0.8437464833259583 ,0 ,142.32125854492188 ,202.75485229492188 ,389.40936279296875 ,1 ]
19+ "far" : 100000
1720 }
1821 },
1922 "scene" : {
2023 "metadata" : {
21- "version" : 4.3 ,
24+ "version" : 4.4 ,
2225 "type" : " Object" ,
23- "generator" : " ObjectExporter "
26+ "generator" : " Object3D.toJSON "
2427 },
2528 "geometries" : [
2629 {
3134 "widthSegments" : 1 ,
3235 "heightSegments" : 1
3336 },
37+ {
38+ "uuid" : " EEDF0A9A-D174-44E4-9C2F-A2F5BB8BE7F5" ,
39+ "type" : " CylinderGeometry" ,
40+ "radiusTop" : 5 ,
41+ "radiusBottom" : 5 ,
42+ "height" : 20 ,
43+ "radialSegments" : 32 ,
44+ "heightSegments" : 1 ,
45+ "openEnded" : false
46+ },
3447 {
3548 "uuid" : " 7149652B-DBD7-4CB7-A600-27A9AC005C95" ,
3649 "type" : " BoxGeometry" ,
5366 "thetaLength" : 3.14
5467 },
5568 {
56- "uuid" : " A1D8B049-74DD-4B08-B5BC-8DCEC9AF0222 " ,
69+ "uuid" : " EFBF641D-F092-462E-B7FB-0BFAD1591EFC " ,
5770 "type" : " BoxGeometry" ,
58- "width" : 40 ,
71+ "width" : 20 ,
5972 "height" : 10 ,
6073 "depth" : 10 ,
6174 "widthSegments" : 1 ,
7285 "shininess" : 30
7386 },
7487 {
75- "uuid" : " CFBEAD4C-6695-4A99-887B-8161E2947225 " ,
88+ "uuid" : " 3B9DE64D-E1C8-4C24-9F73-3A9E10E3E655 " ,
7689 "type" : " MeshPhongMaterial" ,
7790 "color" : 16777215 ,
7891 "emissive" : 0 ,
7992 "specular" : 1118481 ,
8093 "shininess" : 30
8194 },
95+ {
96+ "uuid" : " D98FC4D1-169E-420A-92EA-20E55009A46D" ,
97+ "type" : " MeshBasicMaterial" ,
98+ "wireframe" : true ,
99+ "color" : 63744
100+ },
82101 {
83102 "uuid" : " 043B208C-1F83-42C6-802C-E0E35621C27C" ,
84103 "type" : " MeshPhongMaterial" ,
89108 },
90109 {
91110 "uuid" : " 40EC9BDA-91C0-4671-937A-2BCB6DA7EEBB" ,
92- "type" : " MeshPhongMaterial" ,
93- "color" : 13486790 ,
94- "emissive" : 0 ,
95- "specular" : 1118481 ,
96- "shininess" : 30
111+ "type" : " MeshBasicMaterial" ,
112+ "wireframe" : true ,
113+ "color" : 63744
97114 }],
98115 "object" : {
99116 "uuid" : " 31517222-A9A7-4EAF-B5F6-60751C0BABA3" ,
105122 "uuid" : " EBBB1E63-6318-4752-AE2E-440A4E0B3EF3" ,
106123 "type" : " Mesh" ,
107124 "name" : " Ground" ,
125+ "matrix" : [1 ,0 ,0 ,0 ,0 ,0.0007960614748299122 ,-0.9999997019767761 ,0 ,0 ,0.9999997019767761 ,0.0007960614748299122 ,0 ,0 ,0 ,0 ,1 ],
108126 "geometry" : " 8F05A1F2-3877-478B-8DFC-F572AC61AB3A" ,
109- "material" : " 2F69AF3A-DDF5-4BBA-87B5-80159F90DDBF" ,
110- "matrix" : [1 ,0 ,0 ,0 ,0 ,0.000796250649727881 ,-0.9999997019767761 ,0 ,0 ,0.9999997019767761 ,0.000796250649727881 ,0 ,0 ,0 ,0 ,1 ]
127+ "material" : " 2F69AF3A-DDF5-4BBA-87B5-80159F90DDBF"
111128 },
112129 {
113130 "uuid" : " 6EE2E764-43E0-48E0-85F2-E0C8823C20DC" ,
114131 "type" : " DirectionalLight" ,
115132 "name" : " DirectionalLight 1" ,
133+ "matrix" : [1 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,0 ,0 ,1 ,0 ,100 ,200 ,150 ,1 ],
116134 "color" : 16777215 ,
117- "intensity" : 1 ,
118- "matrix" : [1 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,0 ,0 ,1 ,0 ,100 ,200 ,150 ,1 ]
135+ "intensity" : 1
119136 },
120137 {
121138 "uuid" : " 38219749-1E67-45F2-AB15-E64BA0940CAD" ,
122139 "type" : " Mesh" ,
123140 "name" : " Brick" ,
141+ "matrix" : [1 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,5 ,0 ,1 ],
142+ "children" : [
143+ {
144+ "uuid" : " 711A5955-8F17-4A8B-991A-7604D27E6FA0" ,
145+ "type" : " Mesh" ,
146+ "name" : " Cylinder" ,
147+ "matrix" : [0.0007962009985931218 ,0.0007962677045725286 ,0.9999995231628418 ,0 ,-0.9999997615814209 ,3.462185702574061e-7 ,0.0007962677045725286 ,0 ,2.210134084634774e-7 ,-0.9999997615814209 ,0.0007962008821777999 ,0 ,0 ,0 ,0 ,1 ],
148+ "geometry" : " EEDF0A9A-D174-44E4-9C2F-A2F5BB8BE7F5" ,
149+ "material" : " 3B9DE64D-E1C8-4C24-9F73-3A9E10E3E655"
150+ }],
124151 "geometry" : " 7149652B-DBD7-4CB7-A600-27A9AC005C95" ,
125- "material" : " CFBEAD4C-6695-4A99-887B-8161E2947225" ,
126- "matrix" : [1 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,5 ,0 ,1 ]
152+ "material" : " D98FC4D1-169E-420A-92EA-20E55009A46D"
127153 },
128154 {
129155 "uuid" : " 18FFA67C-F893-4E7A-8A76-8D996DEBE0C6" ,
130156 "type" : " Mesh" ,
131157 "name" : " Ball" ,
158+ "matrix" : [1 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,5 ,35.54999923706055 ,1 ],
132159 "geometry" : " CABCC711-1331-4D4C-9FF6-409299F10C68" ,
133- "material" : " 043B208C-1F83-42C6-802C-E0E35621C27C" ,
134- "matrix" : [1 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,5 ,35.54999923706055 ,1 ]
160+ "material" : " 043B208C-1F83-42C6-802C-E0E35621C27C"
135161 },
136162 {
137163 "uuid" : " 6D660D49-39B8-40C3-95F6-E4E007AA8D79" ,
138164 "type" : " Mesh" ,
139165 "name" : " Paddle" ,
140- "geometry" : " A1D8B049-74DD-4B08-B5BC-8DCEC9AF0222" ,
141- "material" : " 40EC9BDA-91C0-4671-937A-2BCB6DA7EEBB" ,
142- "matrix" : [1 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,5 ,159.54217529296875 ,1 ]
166+ "matrix" : [2 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,5 ,159.5399932861328 ,1 ],
167+ "children" : [
168+ {
169+ "uuid" : " 4F5F884C-9E1B-45E6-8F1E-4D538A46D8CB" ,
170+ "type" : " Mesh" ,
171+ "name" : " Cylinder" ,
172+ "matrix" : [0.0007962009985931218 ,0.0007962677045725286 ,0.9999995231628418 ,0 ,-0.9999997615814209 ,3.462185702574061e-7 ,0.0007962677045725286 ,0 ,2.210134084634774e-7 ,-0.9999997615814209 ,0.0007962008821777999 ,0 ,0 ,0 ,0 ,1 ],
173+ "geometry" : " EEDF0A9A-D174-44E4-9C2F-A2F5BB8BE7F5" ,
174+ "material" : " 3B9DE64D-E1C8-4C24-9F73-3A9E10E3E655"
175+ }],
176+ "geometry" : " EFBF641D-F092-462E-B7FB-0BFAD1591EFC" ,
177+ "material" : " 40EC9BDA-91C0-4671-937A-2BCB6DA7EEBB"
143178 },
144179 {
145180 "uuid" : " B0BEAF69-8B5D-4D87-ADCA-FDE83A02762D" ,
146181 "type" : " PointLight" ,
147182 "name" : " PointLight 2" ,
183+ "matrix" : [1 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,0 ,0 ,1 ,0 ,-116.54356384277344 ,69.48957061767578 ,-206.8248291015625 ,1 ],
148184 "color" : 16777215 ,
149185 "intensity" : 1 ,
150186 "distance" : 0 ,
151- "decay" : 1 ,
152- "matrix" : [1 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,0 ,0 ,1 ,0 ,-116.54356384277344 ,69.48957061767578 ,-206.8248291015625 ,1 ]
187+ "decay" : 1
153188 }]
154189 }
155190 },
162197 "31517222-A9A7-4EAF-B5F6-60751C0BABA3" : [
163198 {
164199 "name" : " Game Logic" ,
165- "source": "var ball = this.getObjectByName( 'Ball' );\n\nvar direction = new THREE.Vector3();\ndirection.x = Math.random() - 0.5;\ndirection.z = - 0.5;\ndirection.normalize();\n\nvar speed = new THREE.Vector3();\n\n//\n\nvar group = new THREE.Group();\nthis.add( group );\n\nvar paddle = this.getObjectByName( 'Paddle' );\ngroup.add( paddle );\n\nvar brick = this.getObjectByName( 'Brick' );\n\nfor ( var j = 0; j < 8; j ++ ) {\n\n\tvar material = new THREE.MeshPhongMaterial( { color: Math.random() * 0xffffff } );\n\n\tfor ( var i = 0; i < 12; i ++ ) {\n\t\t\n\t\tvar object = brick.clone();\n\t\tobject.material = material;\n\t\tobject.position.x = i * 22 - 120;\n\t\tobject.position.z = j * 14 - 120;\n\t\tgroup.add( object );\n\t\t\n\t}\n\t\n}\n\nbrick.visible = false;\n\n//\n\nvar raycaster = new THREE.Raycaster();\n\nfunction update( event ) {\n\t\n\tif ( ball.position.x < - 150 || ball.position.x > 150 ) direction.x = - direction.x;\n\tif ( ball.position.z < - 200 || ball.position.z > 200 ) direction.z = - direction.z;\n\n\tball.position.x = Math.max( - 150, Math.min( 150, ball.position.x ) );\n\tball.position.z = Math.max( - 200, Math.min( 200, ball.position.z ) );\n\t\n\tball.position.add( speed.copy( direction ).multiplyScalar( event.delta / 4 ) );\n\t\n\traycaster.set( ball.position, direction );\n\t\n\tvar intersections = raycaster.intersectObjects( group.children );\n\t\n\tif ( intersections.length > 0 ) {\n\t\n\t\tvar intersection = intersections[ 0 ];\n\t\t\n\t\tif ( intersection.distance < 5 ) {\n\t\t\t\n\t\t\tif ( intersection.object !== paddle ) {\n\n\t\t\t\tgroup.remove( intersection.object );\n\t\t\t\t\n\t\t\t}\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}"
200+ "source": "var ball = this.getObjectByName( 'Ball' );\n\nvar direction = new THREE.Vector3();\ndirection.x = Math.random() - 0.5;\ndirection.z = - 0.5;\ndirection.normalize();\n\nvar speed = new THREE.Vector3();\n\n//\n\nvar group = new THREE.Group();\nthis.add( group );\n\nvar paddle = this.getObjectByName( 'Paddle' );\npaddle.material.visible = false;\ngroup.add( paddle );\n\nvar brick = this.getObjectByName( 'Brick' );\n\nfor ( var j = 0; j < 8; j ++ ) {\n\n\tvar material = new THREE.MeshPhongMaterial( { color: Math.random() * 0xffffff } );\n\n\tfor ( var i = 0; i < 12; i ++ ) {\n\t\t\n\t\tvar object = brick.clone();\n\t\tobject.position.x = i * 22 - 120;\n\t\tobject.position.z = j * 14 - 120;\n\t\tgroup.add( object );\n\n\t\tvar cylinder = object.getObjectByName( 'Cylinder' );\n\t\tcylinder.material = material;\n\n\t}\n\t\n}\n\nbrick.visible = false;\nbrick.material.visible = false;\n\n//\n\nvar raycaster = new THREE.Raycaster();\n\nfunction update( event ) {\n\t\n\tif ( ball.position.x < - 150 || ball.position.x > 150 ) direction.x = - direction.x;\n\tif ( ball.position.z < - 200 || ball.position.z > 200 ) direction.z = - direction.z;\n\n\tball.position.x = Math.max( - 150, Math.min( 150, ball.position.x ) );\n\tball.position.z = Math.max( - 200, Math.min( 200, ball.position.z ) );\n\t\n\tball.position.add( speed.copy( direction ).multiplyScalar( event.delta / 4 ) );\n\t\n\traycaster.set( ball.position, direction );\n\t\n\tvar intersections = raycaster.intersectObjects( group.children );\n\t\n\tif ( intersections.length > 0 ) {\n\t\n\t\tvar intersection = intersections[ 0 ];\n\t\t\n\t\tif ( intersection.distance < 5 ) {\n\t\t\t\n\t\t\tif ( intersection.object !== paddle ) {\n\n\t\t\t\tgroup.remove( intersection.object );\n\t\t\t\t\n\t\t\t}\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}"
166201 }]
167202 }
168203}
0 commit comments