A-Frame
A web framework for building virtual reality experiences.
Features
:eyeglasses: Virtual reality made simple: A-Frame handles the 3D and WebVR boilerplate required to get running across platforms including mobile, desktop, Vive, and Rift just by dropping in <a-scene>
.
:heart: Declarative HTML: A-Frame is accessible to all developers due to its easy-to-read and copy-and-pastable HTML.
⚙ Entity-component pattern: A-Frame is a powerful framework for three.js, providing an declarative, composable, reusable entity-component architecture.
🔨 Tool agnostic: A-Frame interoperates beautifully with JavaScript DOM APIs and most libraries such as React, Vue.js, Angular, or d3.js.
:mag: Visual Inspector: A-Frame provides a built-in visual inspector that acts just like your browser's DevTools; open up a scene and hit <ctrl> + <alt> + i
.
:package: Registry: A-Frame has a Registry, a curated component repository similar to the Unity Asset Store. Install some components and use them right from your HTML.
Usage
Basic Example
To get started playing now, open this CodePen example
scene.
<html>
<head>
<title>My A-Frame Scene</title>
<script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script>
</head>
<body>
<a-scene>
<a-box position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
<a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E"></a-sphere>
<a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
<a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
<a-sky color="#ECECEC"></a-sky>
</a-scene>
</body>
</html>
Builds
To use the latest stable build of A-Frame, include aframe.min.js
:
<head>
<script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script>
</head>
To check out the stable and master builds, see the dist/
folder.
npm
npm install --save aframe
require('aframe')
Local Development
git clone https://github.com/aframevr/aframe.git
cd aframe && npm install
npm start
And open in your browser http://localhost:9000.
Generating Builds
npm run dist
Questions
For questions and support, ask on StackOverflow.
Stay in Touch
Contributing
Get involved! Check out the Contributing Guide for how to get started.
License
This program is free software and is distributed under an MIT License.
0.5.0 (February 09, 2017)
0.5.0 contains text, glTF support, patches to enable WebVR record-and-replay
tools, WebVR polyfill updates, enhancements, and bug fixes.
Major Changes
- Bumped three.js to r83. (#2214)
Deprecations
Enhancements
- Added
text
component for SDF and MSDF text. (#2289) - Added
gltf-model
component for loading glTF 3D models. (#2333) - Added new hand poses for Oculus Touch controls. (#2191)
- Attach
tracked-controls
event listeners even if no physical controllers are
present. (#2314) - Made
Entity.removeAttribute(component, property)
reset a property value to its default. (#2353) - Added
AFRAME.utils.throttleTick
and AFRAME.utils.throttle
utils. (#2189) - Changed
hand-controls
to check for "not Oculus Touch" rather than "is Vive"
to make hand-controls
be compatible with community control components
(e.g., GearVR). (#2192) - Don't cache geometry if merging. (#2255)
- Allow unsetting of mixins with
setAttribute(mixinId, '')
. (#2291) - Allow access to the
screenshot
component canvas (#2316). - Made
stats
component UI more readable. (#2313) - Added warning of registered components contain uppercase characters. (#2233)
- Added warning if entity is appended outside of a scene. (#2240)
- Added warning if geometry merge target is not an entity. (#2243)
- Removed unneeded object equality check getting called on component initialization. (#2322)
- Updated
VREffect
to allow player scaling. (#2328) - Added guides to documentation for Using JavaScript and DOM APIs, Using
with three.js, and Writing a Component (58555a, 982f66, 09a606).
Fixes
- Fixed low iOS resolution and blur issues. (#2352)
- Fixed mobile resolution and canvas sizing issues by using WebVR polyfill with
updated device database. (#2345)
- Fixed potential Vive controller issues across browsers by loosening the
Gamepad ID check to only check for prefix. (#2370)
- Fixed
raycaster.interval
not being applied. (#2363) - Fixed system initialization affecting component updates. (#2367)
- Fixed unstable version of Inspector being injected on shortcut. (#2364)
- Fixed
vive-controls
not tracking. (#2194) - Fixed component updates getting called even if data did not change. (#2322)
- Fixed
envify
causing issues when installing from npm with a bundler. (c62690) - Fixed component updates with
setAttribute
using data
instead of attrValue
. (#2184) - Fixed coordinate parser when passed
null
and when trying to override. (#2209) - Fixed error when
vr-mode-ui
is disabled and embedded
is enabled. (4607e2) - Fixed array property type updates through
AFRAME.utils.deepEqual
. (#2229) - Fixed
init
and update
handlers being called when doing flushToDOM
on
non-loaded entity. (#2250). - Fixed disabling of
fog
. (#2251) - Fixed texture offset and repeats. (#2253)
- Fixed fullscreen not exiting when exiting VR. (#2264)
- Fixed component
pause
and remove
handlers not getting called on scene detach. (#2302) - Fixed multiple
look-controls
instances colliding. (#2335) - Fixed several component properties missing property types. (#2357)