An introduction to VR and building VR experiences with A-Frame
Virtual Reality, or VR, simulates a user’s physical presence in a virtual or imaginary environment
VR is more than just games. There’s VR film and video, documentaries, news stories, journals, adventures, and more.
- Accessibility to enjoy (equipment, culture)
- Accessibility to develop (isolated)
- Misguided “Empathy Machines”
- Sexual Harassment possibilities
A web framework for building virtual reality experiences
- is open-source and accessible by web
- has a deep, small community backed by Mozilla
- uses markup that looks like HTML to be placed in .html files
- encourages fast development/prototyping
- Uses 3D coordinate space like (0, 0, 1)
- Assets are 3D shapes (primitives) or 3D models, or more
- Some special effects are made with particle effects
- Load in the A-Frame framework as javascript
- Put things in a scene
- Asset manager loads declared assets
- Follows an "entity-component system", meaning that an entity (container object) is built from composing together different components (reusable module). In this case, we create HTML entities and define its components as HTML attributes, like so:
<a-entity propertyName1="propertyValue1" propertyName2="propertyValue2"></a-entity>
- In the terminal, clone the repo using
git clone https://github.com/dannielle/a-frame-intro.git
- Navigate to the project with
cd a-frame-intro
- Install the dependencies with
npm install
- Open up
index.html
- Find the head tag and use the correct tag to point to the minified A-frame javascript.
- Read the docs on the a-text tag.
- Within the
a-scene
tag, add ana-text
tag with avalue
of "Hello World!", acolor
of "#000000" and aposition
of "-1 2 -3"
- In your terminal, run the server using
npm start
. Your browser should open up http://localhost:3000/ - Verify that you see the Hello World text
- Add a light source to the scene using an
a-light
tag. Thetype
is "ambient" and thecolor
is "#222". - Add a box to the scene using an
a-box
tag. Theposition
is "0 0.5 -3", therotation
is "0 45 0", and thecolor
is "#DEFACE". - In the assets tag, import the asset using an
img
tag with asrc
ofassets/beltline.jpeg
and anid
of "sky" - Create an
a-sky
tag in thea-scene
tag but outside ofa-assets
. The value of the sky's source is the#sky
id that refers to the asset - In the assets tag, import the asset using an
a-asset-item
tag with a srcassets/bicycle.dae
and anid
of "bike" - Add an
a-collada-model
tag under the sky tag. The value of the model's source is the "#bike" id. Theposition
is "3 1 -2" and therotation
is "0 90 0".
- Make sure your phone and computer are connected to the same Wifi network.
- Find your IP Address. On macs, this is found in System Preferences > Network, and under the "Status" heading.
- On your phone, navigate to
<Your IP address>:3000