未验证 提交 9987d597 编写于 作者: M Michael Herzog 提交者: GitHub

Merge pull request #18015 from Mugen87/dev29

WebXR: Update docs and TS files.
...@@ -20,22 +20,22 @@ ...@@ -20,22 +20,22 @@
<h2>Workflow</h2> <h2>Workflow</h2>
<p> <p>
First, you have to include [link:https://github.com/mrdoob/three.js/blob/master/examples/js/vr/WebVR.js WebVR.js] First, you have to include [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/webxr/VRButton.js VRButton.js]
into your project. into your project.
</p> </p>
<code> <code>
import { WEBVR } from 'three/examples/jsm/vr/WebVR.js'; import { VRButton } from 'three/examples/jsm/webxr/VRButton.js';
</code> </code>
<p> <p>
*WEBVR.createButton()* does two important things: It creates a button which indicates *VRButton.createButton()* does two important things: It creates a button which indicates
VR compatibility. Besides, it initiates a VR session if the user activates the button. The only thing you have VR compatibility. Besides, it initiates a VR session if the user activates the button. The only thing you have
to do is to add the following line of code to your app. to do is to add the following line of code to your app.
</p> </p>
<code> <code>
document.body.appendChild( WEBVR.createButton( renderer ) ); document.body.appendChild( VRButton.createButton( renderer ) );
</code> </code>
<p> <p>
...@@ -65,17 +65,18 @@ renderer.setAnimationLoop( function () { ...@@ -65,17 +65,18 @@ renderer.setAnimationLoop( function () {
<p> <p>
Have a look at one of the official WebVR examples to see this workflow in action.<br /><br /> Have a look at one of the official WebVR examples to see this workflow in action.<br /><br />
[example:webvr_ballshooter WebVR / ballshoter]<br /> [example:webxr_vr_ballshooter WebXR / VR / ballshoter]<br />
[example:webvr_cubes WebVR / cubes]<br /> [example:webxr_vr_cubes WebXR / VR / cubes]<br />
[example:webvr_dragging WebVR / dragging]<br /> [example:webxr_vr_dragging WebXR / VR / dragging]<br />
[example:webvr_lorenzattractor WebVR / lorenzattractor]<br /> [example:webxr_vr_lorenzattractor WebXR / VR / lorenzattractor]<br />
[example:webvr_panorama WebVR / panorama]<br /> [example:webxr_vr_multiview WebXR / VR / multiview]<br />
[example:webvr_paint WebVR / paint]<br /> [example:webxr_vr_paint WebXR / VR / paint]<br />
[example:webvr_rollercoaster WebVR / rollercoaster]<br /> [example:webxr_vr_panorama_depth WebXR / VR / panorama_depth]<br />
[example:webvr_sandbox WebVR / sandbox]<br /> [example:webxr_vr_panorama WebXR / VR / panorama]<br />
[example:webvr_sculpt WebVR / sculpt]<br /> [example:webxr_vr_rollercoaster WebXR / VR / rollercoaster]<br />
[example:webvr_vive_paint WebVR / vive / paint]<br /> [example:webxr_vr_sandbox WebXR / VR / sandbox]<br />
[example:webvr_vive_sculpt WebVR / vive / sculpt]<br /> [example:webxr_vr_sculpt WebXR / VR / sculpt]<br />
[example:webxr_vr_video WebXR / VR / video]
</p> </p>
</body> </body>
......
...@@ -19,21 +19,21 @@ ...@@ -19,21 +19,21 @@
<h2>工作流程</h2> <h2>工作流程</h2>
<p> <p>
首先,你需要将[link:https://github.com/mrdoob/three.js/blob/master/examples/js/vr/WebVR.js WebVR.js] 首先,你需要将[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/webxr/VRButton.js VRButton.js]
包含到你的项目中。 包含到你的项目中。
</p> </p>
<code> <code>
import { WEBVR } from 'three/examples/jsm/vr/WebVR.js'; import { VRButton } from 'three/examples/jsm/webxr/VRButton.js';
</code> </code>
<p>*WEBVR.createButton()*做了两件重要的事情:首先,它创建了一个按钮,指示了VR的兼容性; <p>*VRButton.createButton()*做了两件重要的事情:首先,它创建了一个按钮,指示了VR的兼容性;
此外,若用户激活了这个按钮,则它将开启一个VR会话。 此外,若用户激活了这个按钮,则它将开启一个VR会话。
你所要做的唯一一件事情,便是把下面的这一行代码加入到你的应用程序里。 你所要做的唯一一件事情,便是把下面的这一行代码加入到你的应用程序里。
</p> </p>
<code> <code>
document.body.appendChild( WEBVR.createButton( renderer ) ); document.body.appendChild( VRButton.createButton( renderer ) );
</code> </code>
<p> <p>
...@@ -65,17 +65,18 @@ renderer.setAnimationLoop( function () { ...@@ -65,17 +65,18 @@ renderer.setAnimationLoop( function () {
请查看官方示例中与WebVR相关的示例,了解这一工作流程的实际使用、运行情况。 请查看官方示例中与WebVR相关的示例,了解这一工作流程的实际使用、运行情况。
<br /><br /> <br /><br />
[example:webvr_ballshooter WebVR / ballshoter]<br /> [example:webxr_vr_ballshooter WebXR / VR / ballshoter]<br />
[example:webvr_cubes WebVR / cubes]<br /> [example:webxr_vr_cubes WebXR / VR / cubes]<br />
[example:webvr_dragging WebVR / dragging]<br /> [example:webxr_vr_dragging WebXR / VR / dragging]<br />
[example:webvr_lorenzattractor WebVR / lorenzattractor]<br /> [example:webxr_vr_lorenzattractor WebXR / VR / lorenzattractor]<br />
[example:webvr_panorama WebVR / panorama]<br /> [example:webxr_vr_multiview WebXR / VR / multiview]<br />
[example:webvr_paint WebVR / paint]<br /> [example:webxr_vr_paint WebXR / VR / paint]<br />
[example:webvr_rollercoaster WebVR / rollercoaster]<br /> [example:webxr_vr_panorama_depth WebXR / VR / panorama_depth]<br />
[example:webvr_sandbox WebVR / sandbox]<br /> [example:webxr_vr_panorama WebXR / VR / panorama]<br />
[example:webvr_sculpt WebVR / sculpt]<br /> [example:webxr_vr_rollercoaster WebXR / VR / rollercoaster]<br />
[example:webvr_vive_paint WebVR / vive / paint]<br /> [example:webxr_vr_sandbox WebXR / VR / sandbox]<br />
[example:webvr_vive_sculpt WebVR / vive / sculpt]<br /> [example:webxr_vr_sculpt WebXR / VR / sculpt]<br />
[example:webxr_vr_video WebXR / VR / video]
</p> </p>
</body> </body>
......
import {
WebGLRenderer
} from '../../../src/Three';
export interface WebXROptions {
referenceSpaceType: string;
}
export namespace VRButton {
export function createButton( renderer: WebGLRenderer, options?: WebXROptions  ): HTMLElement;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册