<a-camera>
Note: This documentation is for the old 1.0.0 version of A-Frame. Check out the documentation for the current 1.6.0 version
The camera primitive determines what the user sees. We can change the viewport by modifying the camera entity’s position and rotation.
Example
<a-scene> |
Attributes
Attribute | Component Mapping | Default Value |
---|---|---|
far | camera.far | 10000 |
fov | camera.fov | 80 |
look-controls-enabled | look-controls.enabled | true |
near | camera.near | 0.5 |
reverse-mouse-drag | look-controls.reverseMouseDrag | false |
wasd-controls-enabled | wasd-controls.enabled | true |
Manually Positioning the Camera
A camera is situated by default at the average height of human eye level (1.6 meters). When used with controls that receive rotation or position (e.g. from a VR device) this position will be overridden.
<!-- Place camera at ground level (will be overridden by VR devices) --> |
When moving or rotating the camera relative to the scene, use a camera rig. By doing so, the camera’s height offset can be updated by roomscale devices, while still allowing the tracked area to be moved independently around the scene.
<a-entity id="rig" position="25 10 0"> |