Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 846059 of VRFieldOfViewReadOnly

  • Revision slug: Web/API/VRFieldOfViewReadOnly
  • Revision title: VRFieldOfViewReadOnly
  • Revision id: 846059
  • Created:
  • Creator: MelindaR
  • Is current revision? No
  • Comment Editorial review completed.

Revision Content

{{draft()}}{{ APIRef("WebVR API") }}{{ SeeCompatTable() }}

The VRFieldOfViewReadOnly interface of the WebVR API contains the raw definition for the degree value properties required to define a field of view. Inherited by {{domxref("VRFieldOfView")}}.

Properties

{{domxref("VRFieldOfViewReadOnly.upDegrees")}} {{readonlyInline}}
The number of degrees upward that the field of view extends.
{{domxref("VRFieldOfViewReadOnly.rightDegrees")}} {{readonlyInline}}
The number of degrees to the right that the field of view extends.
{{domxref("VRFieldOfViewReadOnly.downDegrees")}} {{readonlyInline}}
The number of degrees downwards that the field of view extends.
{{domxref("VRFieldOfViewReadOnly.leftDegrees")}} {{readonlyInline}}
The number of degrees to the left that the field of view extends.

Examples

You wouldn't ever use this object directly; for some useful examples see the {{domxref("VRFieldOfView")}} page.

To access the properties directly, you could do something like this:

var lEye = myHMDVRDevice.getEyeParameters('left');

lEye.recommendedFieldOfView.upDegrees
// returns something like 53.09438550469889
lEye.recommendedFieldOfView.rightDegrees
// returns something like 47.52769258067174
lEye.recommendedFieldOfView.downDegrees
// returns something like 53.09438550469889
lEye.recommendedFieldOfView.leftDegrees
// returns something like 46.63209579904155

Specifications

Specification Status Comment
{{SpecName('WebVR','#vrfieldofviewreadonly','VRFieldOfViewReadOnly')}} {{Spec2('WebVR')}} Initial definition

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support Experimental support[1]

 
{{ CompatGeckoDesktop(39)}}
disabled by default[2]
 
{{ CompatNo }}

{{ CompatNo }}

{{ CompatNo }}
Feature Android Firefox Mobile (Gecko) Firefox OS (Gecko) IE Phone Opera Mobile Safari Mobile Chrome for Android
Basic support {{ CompatNo }} {{ CompatGeckoMobile(39)}}
disabled by default[2]
{{ CompatNo }} {{ CompatNo }} {{ CompatNo }} {{ CompatNo }} {{ CompatNo }}


[1] To find information on Chrome's WebVR implementation status including supporting builds, check out Bringing VR to Chrome by Brandon Jones.

[2] To enable WebVR support in Firefox Nightly/Developer Edition, you can go to about:config and enable the dom.vr* prefs. A better option however is to install the WebVR Enabler Add-on, which does this for you and sets up other necessary parts of the environment.

See also

Revision Source

<p>{{draft()}}{{ APIRef("WebVR API") }}{{ SeeCompatTable() }}</p>

<p>The <strong><code>VRFieldOfViewReadOnly</code></strong> interface of the <a href="/en-US/docs/Web/API/WebVR_API">WebVR API</a> contains the raw definition for the degree value properties required to define a field of view. Inherited by {{domxref("VRFieldOfView")}}.</p>

<h2 id="Properties">Properties</h2>

<dl>
 <dt>{{domxref("VRFieldOfViewReadOnly.upDegrees")}} {{readonlyInline}}</dt>
 <dd>The number of degrees upward that the field of view extends.</dd>
 <dt>{{domxref("VRFieldOfViewReadOnly.rightDegrees")}} {{readonlyInline}}</dt>
 <dd>The number of degrees to the right that the field of view extends.</dd>
 <dt>{{domxref("VRFieldOfViewReadOnly.downDegrees")}} {{readonlyInline}}</dt>
 <dd>The number of degrees downwards that the field of view extends.</dd>
 <dt>{{domxref("VRFieldOfViewReadOnly.leftDegrees")}} {{readonlyInline}}</dt>
 <dd>The number of degrees to the left that the field of view extends.</dd>
</dl>

<h2 id="Examples">Examples</h2>

<p>You wouldn't ever use this object directly; for some useful examples see the {{domxref("VRFieldOfView")}} page.</p>

<p>To access the properties directly, you could do something like this:</p>

<pre class="brush: js">var lEye = myHMDVRDevice.getEyeParameters('left');

lEye.recommendedFieldOfView.upDegrees
// returns something like 53.09438550469889
lEye.recommendedFieldOfView.rightDegrees
// returns something like 47.52769258067174
lEye.recommendedFieldOfView.downDegrees
// returns something like 53.09438550469889
lEye.recommendedFieldOfView.leftDegrees
// returns something like 46.63209579904155</pre>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('WebVR','#vrfieldofviewreadonly','VRFieldOfViewReadOnly')}}</td>
   <td>{{Spec2('WebVR')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{ CompatibilityTable() }}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>Experimental support[1]<br>
    <br>
     </td>
   <td>{{ CompatGeckoDesktop(39)}}<br>
    disabled by default[2]<br>
     </td>
   <td>{{ CompatNo }}</td>
   <td>
    <p>{{ CompatNo }}</p>
   </td>
   <td>{{ CompatNo }}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>Firefox OS (Gecko)</th>
   <th>IE Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
   <th>Chrome for Android</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{ CompatNo }}</td>
   <td>{{ CompatGeckoMobile(39)}}<br>
    disabled by default[2]</td>
   <td>{{ CompatNo }}</td>
   <td>{{ CompatNo }}</td>
   <td>{{ CompatNo }}</td>
   <td>{{ CompatNo }}</td>
   <td>{{ CompatNo }}</td>
  </tr>
 </tbody>
</table>
</div>

<p><br>
 [1] To find information on Chrome's WebVR implementation status including supporting builds, check out <a href="https://blog.tojicode.com/2014/07/bringing-vr-to-chrome.html">Bringing VR to Chrome</a> by Brandon Jones.</p>

<p>[2] To enable WebVR support in Firefox Nightly/Developer Edition, you can go to <a>about:config</a> and enable the <code>dom.vr*</code> prefs. A better option however is to install the <a href="https://www.mozvr.com/downloads/webvr-addon-0.1.0.xpi">WebVR Enabler Add-on</a>, which does this for you and sets up other necessary parts of the <a href="/en-US/docs/Web/API/WebVR_API/WebVR_environment_setup">environment</a>.</p>

<h2 id="See_also">See also</h2>

<ul>
 <li><a href="/en-US/docs/Web/API/WebVR_API">WebVR API homepage</a>.</li>
 <li><a href="https://mozvr.com/">MozVr.com</a> — demos, downloads, and other resources from the Mozilla VR team.</li>
</ul>
Revert to this revision