Skip to content

Commit

Permalink
Filled in introduction and devices types sections
Browse files Browse the repository at this point in the history
Also updated IDL file
  • Loading branch information
toji committed Mar 5, 2015
1 parent 3ed3467 commit 7aed1d3
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 37 deletions.
16 changes: 15 additions & 1 deletion webvr.bs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,24 @@ Mailing List Archives: https://mail.mozilla.org/pipermail/web-vr-discuss/

# Introduction # {#intro}

Some introductory notes about WebVR here.
Hardware that enables Virtual Reality applications requires high-precision, low-latency interfaces to deliver an acceptable experience.
Other interfaces, such as device orientation events, can be repurposed to surface VR input but doing so dilutes the interface's original
intent and often does not provide the precision necessary for high quality VR. The WebVR API provides purpose-built interfaces
to VR hardware to allow developers to build compelling, comfortable VR experiences.

# Supported Device Types # {#devtypes}

At this time there are two defined variants of VRDevice, each of which is intended to describe a specific capability of a piece of hardware
rather than all aspects of that hardware. For example, a typical Head Mounted Display such as an Oculus Rift will be exposed as two VRDevices:
An HMDVRDevice that describes the the optical properties of the device, including Field of View and Inter-pupilary Distance, and a
PositionSensorVRDevice, which describes the HMDs position and orientation in space.

A PositionSensorVRDevice could also be provided without a corresponding HMDVRDevice to represent a piece of hardware that tracks position
but does not have a display, such as a Six-degree-of-freedom controller.

Additional VRDevice types may be added over time to expose new hardware types or features as they becomes available to consumers.
Eye tracking is an example of a potential future interface.

# Security # {#security}

Some information about security considerations here.
Expand Down
58 changes: 44 additions & 14 deletions webvr.html
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@
<h1 class="p-name no-ref" id="title">WebVR</h1>

<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft,
<time class="dt-updated" datetime="2015-02-13">13 February 2015</time></span></h2>
<time class="dt-updated" datetime="2015-03-05">5 March 2015</time></span></h2>

<div data-fill-with="spec-metadata">
<dl>
Expand All @@ -571,10 +571,8 @@ <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="cont
<dt>Feedback:
<dd><span><a href="mailto:[email protected]?subject=%5Bwebvr%5D%20feedback">[email protected]</a> with subject line “<kbd>[webvr] <var>… message topic …</var></kbd>” (<a href="https://mail.mozilla.org/pipermail/web-vr-discuss/" rel="discussion">archives</a>)</span>
<dt class="editor">Editors:
<dd class="editor">
<div class="p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:[email protected]">Vladimir Vukicevic</a> (<a class="p-org org" href="http:https://mozilla.com/">Mozilla</a>)</div>
<dd class="editor">
<div class="p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:[email protected]">Brandon Jones</a> (<a class="p-org org" href="http:https://google.com/">Google</a>)</div>
<dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:[email protected]">Vladimir Vukicevic</a> (<a class="p-org org" href="http:https://mozilla.com/">Mozilla</a>)
<dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:[email protected]">Brandon Jones</a> (<a class="p-org org" href="http:https://google.com/">Google</a>)
</dl>
</div>

Expand All @@ -583,7 +581,7 @@ <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="cont
<p class="copyright" data-fill-with="copyright"><a href="http:https://creativecommons.org/publicdomain/zero/1.0/" rel="license"><img alt="CC0" src="https://licensebuttons.net/p/zero/1.0/80x15.png"></a>
To the extent possible under law, the editors have waived all copyright
and related or neighboring rights to this work.
In addition, as of 13 February 2015,
In addition, as of 5 March 2015,
the editors have made this specification available under the
<a href="http:https://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0" rel="license">Open Web Foundation Agreement Version 1.0</a>,
which is available at http:https://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
Expand Down Expand Up @@ -639,11 +637,15 @@ <h2 class="no-num no-toc no-ref heading settled" id="contents"><span class="cont
<li><a href="#ack"><span class="secno">5</span> <span class="content">Acknowledgements</span></a>
<li><a href="#conformance"><span class="secno"></span> <span class="content">
Conformance</span></a>
<li><a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
<ul class="toc">
<li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
<li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
</ul>
<li><a href="#references"><span class="secno"></span> <span class="content">References</span></a>
<ul class="toc">
<li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
</ul>
<li><a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
<li><a href="#idl-index"><span class="secno"></span> <span class="content">IDL Index</span></a>
</ul></div>

Expand All @@ -656,12 +658,29 @@ <h2 class="no-num no-toc no-ref heading settled" id="contents"><span class="cont
<h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#intro"></a></h2>


<p>Some introductory notes about WebVR here.</p>
<p>Hardware that enables Virtual Reality applications requires high-precision, low-latency interfaces to deliver an acceptable experience.
Other interfaces, such as device orientation events, can be repurposed to surface VR input but doing so dilutes the interface’s original
intent and often does not provide the precision necessary for high quality VR. The WebVR API provides purpose-built interfaces
to VR hardware to allow developers to build compelling, comfortable VR experiences.</p>


<h2 class="heading settled" data-level="2" id="devtypes"><span class="secno">2. </span><span class="content">Supported Device Types</span><a class="self-link" href="#devtypes"></a></h2>


<p>At this time there are two defined variants of VRDevice, each of which is intended to describe a specific capability of a piece of hardware
rather than all aspects of that hardware. For example, a typical Head Mounted Display such as an Oculus Rift will be exposed as two VRDevices:
An HMDVRDevice that describes the the optical properties of the device, including Field of View and Inter-pupilary Distance, and a
PositionSensorVRDevice, which describes the HMDs position and orientation in space.</p>


<p>A PositionSensorVRDevice could also be provided without a corresponding HMDVRDevice to represent a piece of hardware that tracks position
but does not have a display, such as a Six-degree-of-freedom controller.</p>


<p>Additional VRDevice types may be added over time to expose new hardware types or features as they becomes available to consumers.
Eye tracking is an example of a potential future interface.</p>


<h2 class="heading settled" data-level="3" id="security"><span class="secno">3. </span><span class="content">Security</span><a class="self-link" href="#security"></a></h2>


Expand Down Expand Up @@ -1067,13 +1086,8 @@ <h2 class="no-ref no-num heading settled" id="conformance"><span class="content"


</p>
<h2 class="no-num heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
<h3 class="no-num heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
<dl>
<dt id="biblio-rfc2119"><a class="self-link" href="#biblio-rfc2119"></a>[rfc2119]
<dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
</dl>
<h2 class="no-num heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
<h3 class="no-num heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
<ul class="indexlist">
<li>angularAcceleration, <a href="#dom-vrpositionstate-angularacceleration">4.3.1</a>
<li>angularVelocity, <a href="#dom-vrpositionstate-angularvelocity">4.3.1</a>
Expand Down Expand Up @@ -1157,6 +1171,22 @@ <h2 class="no-num heading settled" id="index"><span class="content">Index</span>
<li>zFar, <a href="#dom-hmdvrdevice-setfieldofview-zfar">4.6</a>
<li>zNear, <a href="#dom-hmdvrdevice-setfieldofview-znear">4.6</a>
</ul>
<h3 class="no-num heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
<ul class="indexlist">
<li><a data-link-type="biblio" href="#biblio-geometry-1">[geometry-1]</a> defines the following terms:
<ul>
<li><a href="http:https://dev.w3.org/fxtf/geometry/#dom-dompoint">DOMPoint</a>
<li><a href="http:https://dev.w3.org/fxtf/geometry/#dom-domrect">DOMRect</a>
</ul>
</ul>
<h2 class="no-num heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
<h3 class="no-num heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
<dl>
<dt id="biblio-geometry-1"><a class="self-link" href="#biblio-geometry-1"></a>[GEOMETRY-1]
<dd>Simon Pieters; Dirk Schulze; Rik Cabanier. <a href="http:https://www.w3.org/TR/geometry-1/">Geometry Interfaces Module Level 1</a>. 25 November 2014. CR. URL: <a href="http:https://www.w3.org/TR/geometry-1/">http:https://www.w3.org/TR/geometry-1/</a>
<dt id="biblio-rfc2119"><a class="self-link" href="#biblio-rfc2119"></a>[RFC2119]
<dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
</dl>
<h2 class="no-num heading settled" id="idl-index"><span class="content">IDL Index</span><a class="self-link" href="#idl-index"></a></h2>
<pre class="idl">enum <a data-global-name="" href="#enumdef-vreye">VREye</a> { "left", "right" };

Expand Down
43 changes: 21 additions & 22 deletions webvr.idl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ interface VRPositionState {
readonly attribute DOMPoint? angularAcceleration;
};

interface EyeParameters {
/* These values are expected to be static per-device/per-user */
readonly attribute VRFieldOfView minimumFieldOfView;
readonly attribute VRFieldOfView maximumFieldOfView;
readonly attribute VRFieldOfView recommendedFieldOfView;
readonly attribute DOMPoint eyeTranslation;

/* These values will vary after a FOV has been set */
readonly attribute VRFieldOfView currentFieldOfView;
readonly attribute DOMRect renderRect;
};

interface VRDevice {
/**
* An identifier for the distinct hardware unit that this
Expand All @@ -68,17 +80,8 @@ interface VRDevice {
};

interface HMDVRDevice : VRDevice {
/* The translation that should be applied to the view matrix for rendering each eye */
DOMPoint getEyeTranslation(VREye whichEye);

// the FOV that the HMD was configured with
VRFieldOfView getCurrentEyeFieldOfView(VREye whichEye);

// the recommended FOV, per eye.
VRFieldOfView getRecommendedEyeFieldOfView(VREye whichEye);

// the maximum FOV, per eye. Above this, rendering will look broken.
VRFieldOfView getMaximumEyeFieldOfView(VREye whichEye);
// Return the current EyeParameters for the given eye.
EyeParameters getEyeParameters(VREye whichEye);

// Set a field of view. If either of the fields of view is null,
// or if their values are all zeros, then the recommended field of view
Expand All @@ -87,15 +90,6 @@ interface HMDVRDevice : VRDevice {
optional VRFieldOfViewInit rightFOV,
optional double zNear = 0.01,
optional double zFar = 10000.0);

// return a recommended rect for this eye. Only useful for Canvas rendering,
// the x/y coordinates will be the location in the canvas where this eye should
// begin, and the width/height are the dimensions. Any canvas in the appropriate
// ratio will work.
DOMRect getRecommendedEyeRenderRect(VREye whichEye);

// hack for testing
void xxxToggleElementVR(Element element);
};

interface PositionSensorVRDevice : VRDevice {
Expand All @@ -110,8 +104,13 @@ interface PositionSensorVRDevice : VRDevice {
*/
VRPositionState getState(optional double timeOffset = 0.0);

/* Zero this sensor, treating its current position and orientation
/*
* Return the current instantaneous sensor state.
*/
VRPositionState getImmediateState();

/* Reset this sensor, treating its current position and orientation
* as the "origin/zero" values.
*/
void zeroSensor();
void resetSensor();
};

0 comments on commit 7aed1d3

Please sign in to comment.