webxr-look-to-select.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. <!DOCTYPE html><html lang="en"><head>
  2. <meta charset="utf-8">
  3. <title>VR - Look to Select</title>
  4. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  5. <meta name="twitter:card" content="summary_large_image">
  6. <meta name="twitter:site" content="@threejs">
  7. <meta name="twitter:title" content="Three.js – VR - Look to Select">
  8. <meta property="og:image" content="https://threejs.org/files/share.png">
  9. <link rel="shortcut icon" href="../../files/favicon_white.ico" media="(prefers-color-scheme: dark)">
  10. <link rel="shortcut icon" href="../../files/favicon.ico" media="(prefers-color-scheme: light)">
  11. <link rel="stylesheet" href="../resources/lesson.css">
  12. <link rel="stylesheet" href="../resources/lang.css">
  13. <script type="importmap">
  14. {
  15. "imports": {
  16. "three": "../../build/three.module.js"
  17. }
  18. }
  19. </script>
  20. </head>
  21. <body>
  22. <div class="container">
  23. <div class="lesson-title">
  24. <h1>VR - Look to Select</h1>
  25. </div>
  26. <div class="lesson">
  27. <div class="lesson-main">
  28. <p><strong>NOTE: The examples on this page require a VR capable
  29. device. Without one they won't work. See <a href="webxr.html">previous article</a>
  30. as to why</strong></p>
  31. <p>In the <a href="webxr.html">previous article</a> we went over
  32. a very simple VR example using three.js and we discussed
  33. the various kinds of VR systems.</p>
  34. <p>The simplest and possibly most common is the Google Cardboard style of VR which
  35. is basically a phone put into a $5 - $50 face mask. This kind of VR has no
  36. controller so people have to come up with creative solutions for allowing user
  37. input.</p>
  38. <p>The most common solution is "look to select" where if the
  39. user points their head at something for a moment it gets
  40. selected.</p>
  41. <p>Let's implement "look to select"! We'll start with
  42. <a href="webxr.html">an example from the previous article</a>
  43. and to do it we'll add the <code class="notranslate" translate="no">PickHelper</code> we made in
  44. <a href="picking.html">the article on picking</a>. Here it is.</p>
  45. <pre class="prettyprint showlinemods notranslate lang-js" translate="no">class PickHelper {
  46. constructor() {
  47. this.raycaster = new THREE.Raycaster();
  48. this.pickedObject = null;
  49. this.pickedObjectSavedColor = 0;
  50. }
  51. pick(normalizedPosition, scene, camera, time) {
  52. // restore the color if there is a picked object
  53. if (this.pickedObject) {
  54. this.pickedObject.material.emissive.setHex(this.pickedObjectSavedColor);
  55. this.pickedObject = undefined;
  56. }
  57. // cast a ray through the frustum
  58. this.raycaster.setFromCamera(normalizedPosition, camera);
  59. // get the list of objects the ray intersected
  60. const intersectedObjects = this.raycaster.intersectObjects(scene.children);
  61. if (intersectedObjects.length) {
  62. // pick the first object. It's the closest one
  63. this.pickedObject = intersectedObjects[0].object;
  64. // save its color
  65. this.pickedObjectSavedColor = this.pickedObject.material.emissive.getHex();
  66. // set its emissive color to flashing red/yellow
  67. this.pickedObject.material.emissive.setHex((time * 8) % 2 &gt; 1 ? 0xFFFF00 : 0xFF0000);
  68. }
  69. }
  70. }
  71. </pre>
  72. <p>For an explanation of that code <a href="picking.html">see the article on picking</a>.</p>
  73. <p>To use it we just need to create an instance and call it in our render loop</p>
  74. <pre class="prettyprint showlinemods notranslate lang-js" translate="no">+const pickHelper = new PickHelper();
  75. ...
  76. function render(time) {
  77. time *= 0.001;
  78. ...
  79. + // 0, 0 is the center of the view in normalized coordinates.
  80. + pickHelper.pick({x: 0, y: 0}, scene, camera, time);
  81. </pre>
  82. <p>In the original picking example we converted the mouse coordinates
  83. from CSS pixels into normalized coordinates that go from -1 to +1
  84. across the canvas.</p>
  85. <p>In this case though we will always pick where the camera is
  86. facing which is the center of the screen so we pass in <code class="notranslate" translate="no">0</code> for
  87. both <code class="notranslate" translate="no">x</code> and <code class="notranslate" translate="no">y</code> which is the center in normalized coordinates.</p>
  88. <p>And with that objects will flash when we look at them</p>
  89. <p></p><div translate="no" class="threejs_example_container notranslate">
  90. <div><iframe class="threejs_example notranslate" translate="no" style=" " src="/manual/examples/resources/editor.html?url=/manual/examples/webxr-look-to-select.html"></iframe></div>
  91. <a class="threejs_center" href="/manual/examples/webxr-look-to-select.html" target="_blank">click here to open in a separate window</a>
  92. </div>
  93. <p></p>
  94. <p>Typically we don't want selection to be immediate. Instead we require the user
  95. to keep the camera on the thing they want to select for a few moments to give them
  96. a chance not to select something by accident.</p>
  97. <p>To do that we need some kind of meter or gauge or some way
  98. to convey that the user must keep looking and for how long.</p>
  99. <p>One easy way we could do that is to make a 2 color texture
  100. and use a texture offset to slide the texture across a model.</p>
  101. <p>Let's do this by itself to see it work before we add it to
  102. the VR example.</p>
  103. <p>First we make an <a href="/docs/#api/en/cameras/OrthographicCamera"><code class="notranslate" translate="no">OrthographicCamera</code></a></p>
  104. <pre class="prettyprint showlinemods notranslate lang-js" translate="no">const left = -2; // Use values for left
  105. const right = 2; // right, top and bottom
  106. const top = 1; // that match the default
  107. const bottom = -1; // canvas size.
  108. const near = -1;
  109. const far = 1;
  110. const camera = new THREE.OrthographicCamera(left, right, top, bottom, near, far);
  111. </pre>
  112. <p>And of course update it if the canvas changes size</p>
  113. <pre class="prettyprint showlinemods notranslate lang-js" translate="no">function render(time) {
  114. time *= 0.001;
  115. if (resizeRendererToDisplaySize(renderer)) {
  116. const canvas = renderer.domElement;
  117. const aspect = canvas.clientWidth / canvas.clientHeight;
  118. + camera.left = -aspect;
  119. + camera.right = aspect;
  120. camera.updateProjectionMatrix();
  121. }
  122. ...
  123. </pre>
  124. <p>We now have a camera that shows 2 units above and below the center and aspect units
  125. left and right.</p>
  126. <p>Next let's make a 2 color texture. We'll use a <a href="/docs/#api/en/textures/DataTexture"><code class="notranslate" translate="no">DataTexture</code></a>
  127. which we've used a few <a href="indexed-textures.html">other</a>
  128. <a href="post-processing-3dlut.html">places</a>.</p>
  129. <pre class="prettyprint showlinemods notranslate lang-js" translate="no">function makeDataTexture(data, width, height) {
  130. const texture = new THREE.DataTexture(data, width, height, THREE.RGBAFormat);
  131. texture.minFilter = THREE.NearestFilter;
  132. texture.magFilter = THREE.NearestFilter;
  133. texture.needsUpdate = true;
  134. return texture;
  135. }
  136. const cursorColors = new Uint8Array([
  137. 64, 64, 64, 64, // dark gray
  138. 255, 255, 255, 255, // white
  139. ]);
  140. const cursorTexture = makeDataTexture(cursorColors, 2, 1);
  141. </pre>
  142. <p>We'll then use that texture on a <a href="/docs/#api/en/geometries/TorusGeometry"><code class="notranslate" translate="no">TorusGeometry</code></a></p>
  143. <pre class="prettyprint showlinemods notranslate lang-js" translate="no">const ringRadius = 0.4;
  144. const tubeRadius = 0.1;
  145. const tubeSegments = 4;
  146. const ringSegments = 64;
  147. const cursorGeometry = new THREE.TorusGeometry(
  148. ringRadius, tubeRadius, tubeSegments, ringSegments);
  149. const cursorMaterial = new THREE.MeshBasicMaterial({
  150. color: 'white',
  151. map: cursorTexture,
  152. transparent: true,
  153. blending: THREE.CustomBlending,
  154. blendSrc: THREE.OneMinusDstColorFactor,
  155. blendDst: THREE.OneMinusSrcColorFactor,
  156. });
  157. const cursor = new THREE.Mesh(cursorGeometry, cursorMaterial);
  158. scene.add(cursor);
  159. </pre>
  160. <p>and then in <code class="notranslate" translate="no">render</code> lets adjust the texture's offset</p>
  161. <pre class="prettyprint showlinemods notranslate lang-js" translate="no">function render(time) {
  162. time *= 0.001;
  163. if (resizeRendererToDisplaySize(renderer)) {
  164. const canvas = renderer.domElement;
  165. const aspect = canvas.clientWidth / canvas.clientHeight;
  166. camera.left = -aspect;
  167. camera.right = aspect;
  168. camera.updateProjectionMatrix();
  169. }
  170. + const fromStart = 0;
  171. + const fromEnd = 2;
  172. + const toStart = -0.5;
  173. + const toEnd = 0.5;
  174. + cursorTexture.offset.x = THREE.MathUtils.mapLinear(
  175. + time % 2,
  176. + fromStart, fromEnd,
  177. + toStart, toEnd);
  178. renderer.render(scene, camera);
  179. }
  180. </pre>
  181. <p><code class="notranslate" translate="no">THREE.MathUtils.mapLinear</code> takes a value that goes between <code class="notranslate" translate="no">fromStart</code> and <code class="notranslate" translate="no">fromEnd</code>
  182. and maps it to a value between <code class="notranslate" translate="no">toStart</code> and <code class="notranslate" translate="no">toEnd</code>. In the case above we're
  183. taking <code class="notranslate" translate="no">time % 2</code> which means a value that goes from 0 to 2 and maps
  184. that to a value that goes from -0.5 to 0.5</p>
  185. <p><a href="textures.html">Textures</a> are mapped to geometry using normalized texture coordinates
  186. that go from 0 to 1. That means our 2x1 pixel image, set to the default
  187. wrapping mode of <code class="notranslate" translate="no">THREE.ClampToEdge</code>, if we adjust the
  188. texture coordinates by -0.5 then the entire mesh will be the first color
  189. and if we adjust the texture coordinates by +0.5 the entire mesh will
  190. be the second color. In between with the filtering set to <code class="notranslate" translate="no">THREE.NearestFilter</code>
  191. we'll be able to move the transition between the 2 colors through the geometry.</p>
  192. <p>Let's add a background texture while we're at it just like we
  193. covered in <a href="backgrounds.html">the article on backgrounds</a>.
  194. We'll just use a 2x2 set of colors but set the texture's repeat
  195. settings to give us an 8x8 grid. This will give our cursor something
  196. to be rendered over so we can check it against different colors.</p>
  197. <pre class="prettyprint showlinemods notranslate lang-js" translate="no">+const backgroundColors = new Uint8Array([
  198. + 0, 0, 0, 255, // black
  199. + 90, 38, 38, 255, // dark red
  200. + 100, 175, 103, 255, // medium green
  201. + 255, 239, 151, 255, // light yellow
  202. +]);
  203. +const backgroundTexture = makeDataTexture(backgroundColors, 2, 2);
  204. +backgroundTexture.wrapS = THREE.RepeatWrapping;
  205. +backgroundTexture.wrapT = THREE.RepeatWrapping;
  206. +backgroundTexture.repeat.set(4, 4);
  207. const scene = new THREE.Scene();
  208. +scene.background = backgroundTexture;
  209. </pre>
  210. <p>Now if we run that you'll see we get a circle like gauge
  211. and that we can set where the gauge is.</p>
  212. <p></p><div translate="no" class="threejs_example_container notranslate">
  213. <div><iframe class="threejs_example notranslate" translate="no" style=" " src="/manual/examples/resources/editor.html?url=/manual/examples/webxr-look-to-select-selector.html"></iframe></div>
  214. <a class="threejs_center" href="/manual/examples/webxr-look-to-select-selector.html" target="_blank">click here to open in a separate window</a>
  215. </div>
  216. <p></p>
  217. <p>A few things to notice <strong>and try</strong>.</p>
  218. <ul>
  219. <li><p>We set the <code class="notranslate" translate="no">cursorMaterial</code>'s <code class="notranslate" translate="no">blending</code>, <code class="notranslate" translate="no">blendSrc</code> and <code class="notranslate" translate="no">blendDst</code>
  220. properties as follows</p>
  221. <pre class="prettyprint showlinemods notranslate notranslate" translate="no"> blending: THREE.CustomBlending,
  222. blendSrc: THREE.OneMinusDstColorFactor,
  223. blendDst: THREE.OneMinusSrcColorFactor,
  224. </pre><p>This gives as an <em>inverse</em> type of effect. Comment out
  225. those 3 lines and you'll see the difference. I'm just guessing
  226. the inverse effect is best here as that way we can hopefully
  227. see the cursor regardless of the colors it is over.</p>
  228. </li>
  229. <li><p>We use a <a href="/docs/#api/en/geometries/TorusGeometry"><code class="notranslate" translate="no">TorusGeometry</code></a> and not a <a href="/docs/#api/en/geometries/RingGeometry"><code class="notranslate" translate="no">RingGeometry</code></a></p>
  230. <p>For whatever reason the <a href="/docs/#api/en/geometries/RingGeometry"><code class="notranslate" translate="no">RingGeometry</code></a> uses a flat
  231. UV mapping scheme. Because of this if we use a <a href="/docs/#api/en/geometries/RingGeometry"><code class="notranslate" translate="no">RingGeometry</code></a>
  232. the texture slides horizontally across the ring instead of
  233. around it like it does above.</p>
  234. <p>Try it out, change the <a href="/docs/#api/en/geometries/TorusGeometry"><code class="notranslate" translate="no">TorusGeometry</code></a> to a <a href="/docs/#api/en/geometries/RingGeometry"><code class="notranslate" translate="no">RingGeometry</code></a>
  235. (it's just commented out in the example above) and you'll see what I
  236. mean.</p>
  237. <p>The <em>proper</em> thing to do (for some definition of <em>proper</em>) would be
  238. to either use the <a href="/docs/#api/en/geometries/RingGeometry"><code class="notranslate" translate="no">RingGeometry</code></a> but fix the texture coordinates
  239. so they go around the ring. Or else, generate our own ring geometry.
  240. But, the torus works just fine. Placed directly in front of the camera
  241. with a <a href="/docs/#api/en/materials/MeshBasicMaterial"><code class="notranslate" translate="no">MeshBasicMaterial</code></a> it will look exactly like a ring and the
  242. texture coordinates go around the ring so it works for our needs.</p>
  243. </li>
  244. </ul>
  245. <p>Let's integrate it with our VR code above. </p>
  246. <pre class="prettyprint showlinemods notranslate lang-js" translate="no">class PickHelper {
  247. - constructor() {
  248. + constructor(camera) {
  249. this.raycaster = new THREE.Raycaster();
  250. this.pickedObject = null;
  251. - this.pickedObjectSavedColor = 0;
  252. + const cursorColors = new Uint8Array([
  253. + 64, 64, 64, 64, // dark gray
  254. + 255, 255, 255, 255, // white
  255. + ]);
  256. + this.cursorTexture = makeDataTexture(cursorColors, 2, 1);
  257. +
  258. + const ringRadius = 0.4;
  259. + const tubeRadius = 0.1;
  260. + const tubeSegments = 4;
  261. + const ringSegments = 64;
  262. + const cursorGeometry = new THREE.TorusGeometry(
  263. + ringRadius, tubeRadius, tubeSegments, ringSegments);
  264. +
  265. + const cursorMaterial = new THREE.MeshBasicMaterial({
  266. + color: 'white',
  267. + map: this.cursorTexture,
  268. + transparent: true,
  269. + blending: THREE.CustomBlending,
  270. + blendSrc: THREE.OneMinusDstColorFactor,
  271. + blendDst: THREE.OneMinusSrcColorFactor,
  272. + });
  273. + const cursor = new THREE.Mesh(cursorGeometry, cursorMaterial);
  274. + // add the cursor as a child of the camera
  275. + camera.add(cursor);
  276. + // and move it in front of the camera
  277. + cursor.position.z = -1;
  278. + const scale = 0.05;
  279. + cursor.scale.set(scale, scale, scale);
  280. + this.cursor = cursor;
  281. +
  282. + this.selectTimer = 0;
  283. + this.selectDuration = 2;
  284. + this.lastTime = 0;
  285. }
  286. pick(normalizedPosition, scene, camera, time) {
  287. + const elapsedTime = time - this.lastTime;
  288. + this.lastTime = time;
  289. - // restore the color if there is a picked object
  290. - if (this.pickedObject) {
  291. - this.pickedObject.material.emissive.setHex(this.pickedObjectSavedColor);
  292. - this.pickedObject = undefined;
  293. - }
  294. + const lastPickedObject = this.pickedObject;
  295. + this.pickedObject = undefined;
  296. // cast a ray through the frustum
  297. this.raycaster.setFromCamera(normalizedPosition, camera);
  298. // get the list of objects the ray intersected
  299. const intersectedObjects = this.raycaster.intersectObjects(scene.children);
  300. if (intersectedObjects.length) {
  301. // pick the first object. It's the closest one
  302. this.pickedObject = intersectedObjects[0].object;
  303. - // save its color
  304. - this.pickedObjectSavedColor = this.pickedObject.material.emissive.getHex();
  305. - // set its emissive color to flashing red/yellow
  306. - this.pickedObject.material.emissive.setHex((time * 8) % 2 &gt; 1 ? 0xFFFF00 : 0xFF0000);
  307. }
  308. + // show the cursor only if it's hitting something
  309. + this.cursor.visible = this.pickedObject ? true : false;
  310. +
  311. + let selected = false;
  312. +
  313. + // if we're looking at the same object as before
  314. + // increment time select timer
  315. + if (this.pickedObject &amp;&amp; lastPickedObject === this.pickedObject) {
  316. + this.selectTimer += elapsedTime;
  317. + if (this.selectTimer &gt;= this.selectDuration) {
  318. + this.selectTimer = 0;
  319. + selected = true;
  320. + }
  321. + } else {
  322. + this.selectTimer = 0;
  323. + }
  324. +
  325. + // set cursor material to show the timer state
  326. + const fromStart = 0;
  327. + const fromEnd = this.selectDuration;
  328. + const toStart = -0.5;
  329. + const toEnd = 0.5;
  330. + this.cursorTexture.offset.x = THREE.MathUtils.mapLinear(
  331. + this.selectTimer,
  332. + fromStart, fromEnd,
  333. + toStart, toEnd);
  334. +
  335. + return selected ? this.pickedObject : undefined;
  336. }
  337. }
  338. </pre>
  339. <p>You can see the code above we added all the code to create
  340. the cursor geometry, texture, and material and we added it
  341. as a child of the camera so it will always be in front of
  342. the camera. Note we need to add the camera to the scene
  343. otherwise the cursor won't be rendered.</p>
  344. <pre class="prettyprint showlinemods notranslate lang-js" translate="no">+scene.add(camera);
  345. </pre>
  346. <p>We then check if the thing we're picking this time is the same as it was last
  347. time. If so we add the elapsed time to a timer and if the timer reaches its
  348. limit we return the selected item.</p>
  349. <p>Now let's use that to pick the cubes. As a simple example
  350. we'll add 3 spheres as well. When a cube is picked with hide
  351. the cube and un-hide the corresponding sphere.</p>
  352. <p>So first we'll make a sphere geometry</p>
  353. <pre class="prettyprint showlinemods notranslate lang-js" translate="no">const boxWidth = 1;
  354. const boxHeight = 1;
  355. const boxDepth = 1;
  356. -const geometry = new THREE.BoxGeometry(boxWidth, boxHeight, boxDepth);
  357. +const boxGeometry = new THREE.BoxGeometry(boxWidth, boxHeight, boxDepth);
  358. +
  359. +const sphereRadius = 0.5;
  360. +const sphereGeometry = new THREE.SphereGeometry(sphereRadius);
  361. </pre>
  362. <p>Then let's create 3 pairs of box and sphere meshes. We'll
  363. use a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map"><code class="notranslate" translate="no">Map</code></a>
  364. so that we can associate each <a href="/docs/#api/en/objects/Mesh"><code class="notranslate" translate="no">Mesh</code></a> with its partner.</p>
  365. <pre class="prettyprint showlinemods notranslate lang-js" translate="no">-const cubes = [
  366. - makeInstance(geometry, 0x44aa88, 0),
  367. - makeInstance(geometry, 0x8844aa, -2),
  368. - makeInstance(geometry, 0xaa8844, 2),
  369. -];
  370. +const meshToMeshMap = new Map();
  371. +[
  372. + { x: 0, boxColor: 0x44aa88, sphereColor: 0xFF4444, },
  373. + { x: 2, boxColor: 0x8844aa, sphereColor: 0x44FF44, },
  374. + { x: -2, boxColor: 0xaa8844, sphereColor: 0x4444FF, },
  375. +].forEach((info) =&gt; {
  376. + const {x, boxColor, sphereColor} = info;
  377. + const sphere = makeInstance(sphereGeometry, sphereColor, x);
  378. + const box = makeInstance(boxGeometry, boxColor, x);
  379. + // hide the sphere
  380. + sphere.visible = false;
  381. + // map the sphere to the box
  382. + meshToMeshMap.set(box, sphere);
  383. + // map the box to the sphere
  384. + meshToMeshMap.set(sphere, box);
  385. +});
  386. </pre>
  387. <p>In <code class="notranslate" translate="no">render</code> where we rotate the cubes we need to iterate over <code class="notranslate" translate="no">meshToMeshMap</code>
  388. instead of <code class="notranslate" translate="no">cubes</code>.</p>
  389. <pre class="prettyprint showlinemods notranslate lang-js" translate="no">-cubes.forEach((cube, ndx) =&gt; {
  390. +let ndx = 0;
  391. +for (const mesh of meshToMeshMap.keys()) {
  392. const speed = 1 + ndx * .1;
  393. const rot = time * speed;
  394. - cube.rotation.x = rot;
  395. - cube.rotation.y = rot;
  396. -});
  397. + mesh.rotation.x = rot;
  398. + mesh.rotation.y = rot;
  399. + ++ndx;
  400. +}
  401. </pre>
  402. <p>And now we can use our new <code class="notranslate" translate="no">PickHelper</code> implementation
  403. to select one of the objects. When selected we hide
  404. that object and un-hide its partner.</p>
  405. <pre class="prettyprint showlinemods notranslate lang-js" translate="no">// 0, 0 is the center of the view in normalized coordinates.
  406. -pickHelper.pick({x: 0, y: 0}, scene, camera, time);
  407. +const selectedObject = pickHelper.pick({x: 0, y: 0}, scene, camera, time);
  408. +if (selectedObject) {
  409. + selectedObject.visible = false;
  410. + const partnerObject = meshToMeshMap.get(selectedObject);
  411. + partnerObject.visible = true;
  412. +}
  413. </pre>
  414. <p>And with that we should have a pretty decent <em>look to select</em> implementation.</p>
  415. <p></p><div translate="no" class="threejs_example_container notranslate">
  416. <div><iframe class="threejs_example notranslate" translate="no" style=" " src="/manual/examples/resources/editor.html?url=/manual/examples/webxr-look-to-select-w-cursor.html"></iframe></div>
  417. <a class="threejs_center" href="/manual/examples/webxr-look-to-select-w-cursor.html" target="_blank">click here to open in a separate window</a>
  418. </div>
  419. <p></p>
  420. <p>I hope this example gave some ideas of how to implement a "look to select"
  421. type of Google Cardboard level UX. Sliding textures using texture coordinates
  422. offsets is also a commonly useful technique.</p>
  423. <p>Next up <a href="webxr-point-to-select.html">let's allow the user that has a VR controller to point at and move things</a>.</p>
  424. </div>
  425. </div>
  426. </div>
  427. <script src="../resources/prettify.js"></script>
  428. <script src="../resources/lesson.js"></script>
  429. </body></html>