Skip to content

Commit

Permalink
Examples: Added shadows to new webxr hand examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed May 11, 2021
1 parent 02a82dd commit 4926b07
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/webxr_vr_handinput_pointerclick.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@
const geometry = new THREE.BoxGeometry( x, y, z );
const material = new THREE.MeshPhongMaterial( { color: color } );
const buttonMesh = new THREE.Mesh( geometry, material );
buttonMesh.castShadow = true;
buttonMesh.receiveShadow = true;
return buttonMesh;

}
Expand Down Expand Up @@ -348,6 +350,7 @@
const floorMaterial = new THREE.MeshPhongMaterial( { color: 0x222222 } );
const floor = new THREE.Mesh( floorGeometry, floorMaterial );
floor.rotation.x = - Math.PI / 2;
floor.receiveShadow = true;
scene.add( floor );

const menuGeometry = new THREE.PlaneGeometry( 0.24, 0.5 );
Expand Down
1 change: 1 addition & 0 deletions examples/webxr_vr_handinput_pointerdrag.html
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@
const floorMaterial = new THREE.MeshPhongMaterial( { color: 0x222222 } );
const floor = new THREE.Mesh( floorGeometry, floorMaterial );
floor.rotation.x = - Math.PI / 2;
floor.receiveShadow = true;
scene.add( floor );

const menuGeometry = new THREE.PlaneGeometry( 0.24, 0.5 );
Expand Down
5 changes: 5 additions & 0 deletions examples/webxr_vr_handinput_pressbutton.html
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@
const geometry = new THREE.BoxGeometry( x, y, z );
const material = new THREE.MeshPhongMaterial( { color: color } );
const buttonMesh = new THREE.Mesh( geometry, material );
buttonMesh.castShadow = true;
buttonMesh.receiveShadow = true;
return buttonMesh;

}
Expand Down Expand Up @@ -406,12 +408,15 @@
const floorMaterial = new THREE.MeshPhongMaterial( { color: 0x222222 } );
const floor = new THREE.Mesh( floorGeometry, floorMaterial );
floor.rotation.x = - Math.PI / 2;
floor.receiveShadow = true;
scene.add( floor );

const consoleGeometry = new THREE.BoxGeometry( 0.5, 0.12, 0.15 );
const consoleMaterial = new THREE.MeshPhongMaterial( { color: 0x595959 } );
const consoleMesh = new THREE.Mesh( consoleGeometry, consoleMaterial );
consoleMesh.position.set( 0, 1, - 0.3 );
consoleMesh.castShadow = true;
consoleMesh.receiveShadow = true;
scene.add( consoleMesh );

const orangeButton = makeButtonMesh( 0.08, 0.1, 0.08, 0xffd3b5 );
Expand Down

0 comments on commit 4926b07

Please sign in to comment.