|
@@ -67,7 +67,6 @@
|
|
|
"uuid": "2F69AF3A-DDF5-4BBA-87B5-80159F90DDBF",
|
|
|
"type": "MeshPhongMaterial",
|
|
|
"color": 86015,
|
|
|
- "ambient": 16777215,
|
|
|
"emissive": 0,
|
|
|
"specular": 1118481,
|
|
|
"shininess": 30
|
|
@@ -76,7 +75,6 @@
|
|
|
"uuid": "CFBEAD4C-6695-4A99-887B-8161E2947225",
|
|
|
"type": "MeshPhongMaterial",
|
|
|
"color": 16777215,
|
|
|
- "ambient": 16777215,
|
|
|
"emissive": 0,
|
|
|
"specular": 1118481,
|
|
|
"shininess": 30
|
|
@@ -85,7 +83,6 @@
|
|
|
"uuid": "043B208C-1F83-42C6-802C-E0E35621C27C",
|
|
|
"type": "MeshPhongMaterial",
|
|
|
"color": 16777215,
|
|
|
- "ambient": 16777215,
|
|
|
"emissive": 0,
|
|
|
"specular": 1118481,
|
|
|
"shininess": 30
|
|
@@ -94,7 +91,6 @@
|
|
|
"uuid": "40EC9BDA-91C0-4671-937A-2BCB6DA7EEBB",
|
|
|
"type": "MeshPhongMaterial",
|
|
|
"color": 13486790,
|
|
|
- "ambient": 16777215,
|
|
|
"emissive": 0,
|
|
|
"specular": 1118481,
|
|
|
"shininess": 30
|
|
@@ -168,4 +164,4 @@
|
|
|
"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.add( speed.copy( direction ).multiplyScalar( 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}"
|
|
|
}]
|
|
|
}
|
|
|
-}
|
|
|
+}
|