Skip to content

Commit

Permalink
Fix broken link to WebXR Geometry guide (mdn#4385)
Browse files Browse the repository at this point in the history
  • Loading branch information
saitonakamura authored Apr 23, 2021
1 parent 774d191 commit c70ad7c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ <h3 id="Preparing_to_render_the_scene">Preparing to render the scene</h3>
<p>At this point, the <code>XRSession</code> itself has been fully configured, so we can begin rendering. First, we need a reference space within which coordinates for the world will be stated. We can get the initial reference space for the session by calling the <code>XRSession</code>'s {{domxref("XRSession.requestReferenceSpace", "requestReferenceSpace()")}} method. We specify when calling <code>requestReferenceSpace()</code> the name of the type of reference space we want; in this case, <code>unbounded</code>. You might just as easily specify <code>local</code> or <code>viewer</code>, depending on your needs.</p>

<div class="notecard note">
<p>To understand how to select the right reference space for your needs, see {{SectionOnPage("en-US/docs/Web/API/WebXR_Device_API/Geometry", "Selecting the reference space type")}}.</p>
<p>To understand how to select the right reference space for your needs, see {{SectionOnPage("/en-US/docs/Web/API/WebXR_Device_API/Geometry", "Selecting the reference space type")}}.</p>
</div>

<p>The reference space returned by <code>requestReferenceSpace()</code> places the origin (0, 0, 0) in the center of the space. This is great—if your player's viewpoint starts in the exact center of the world. But most likely, that's not the case at all. If that's so, you call {{domxref("XRReferenceSpace.getOffsetReferenceSpace", "getOffsetReferenceSpace()")}} on the initial reference space to create a <em>new</em> reference space <a href="/en-US/docs/Web/API/WebXR_Device_API/Geometry#establishing_the_reference_space">which offsets the coordinate system</a> so that (0, 0, 0) is located at the position of the viewer, with the orientation likewise shifted to face in the desired direction. The input value into <code>getOffsetReferenceSpace()</code> is an {{domxref("XRRigidTransform")}} encapsulating the player's position and orientation as specified in the default world coordinates.</p>
Expand Down

0 comments on commit c70ad7c

Please sign in to comment.