Browse Source

Example: Orient objects normal to hittest in webxr_ar_hittest (#23573)

* Orient objects normal to hittest in example

* Update webxr_ar_hittest.html

Co-authored-by: mrdoob <[email protected]>
Alexandre Devaux 3 years ago
parent
commit
a7863bd6d2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      examples/webxr_ar_hittest.html

+ 1 - 1
examples/webxr_ar_hittest.html

@@ -76,7 +76,7 @@
 
 
 						const material = new THREE.MeshPhongMaterial( { color: 0xffffff * Math.random() } );
 						const material = new THREE.MeshPhongMaterial( { color: 0xffffff * Math.random() } );
 						const mesh = new THREE.Mesh( geometry, material );
 						const mesh = new THREE.Mesh( geometry, material );
-						mesh.position.setFromMatrixPosition( reticle.matrix );
+						reticle.matrix.decompose( mesh.position, mesh.quaternion, mesh.scale );
 						mesh.scale.y = Math.random() * 2 + 1;
 						mesh.scale.y = Math.random() * 2 + 1;
 						scene.add( mesh );
 						scene.add( mesh );