{{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
- WebVR API homepage.
- MozVr.com — demos, downloads, and other resources from the Mozilla VR team.