aframe-playground

A playground for learning about A-frame

View the Project on GitHub jgbarah/aframe-playground

Seminar (first session)

This session will show the most basic aspects of A-Frame.

Basic example

We will start with the canonical basic HTML A-Frame scene:

At this point, it is convenient that you also read the first part of Building a Basic Scene.

Basic working environment

To work comfortably, we will use some tools:

The usual workflow will be as follows:

While checking the XR scenes in the desktop browser, we can also use the A-Frame Inspector and/or, if you know how to use them, the Developer Tools of your browser.

In general, everything in this seminar works with Firefox and Chromium in desktop, with Chromium in Android phones and tablets, and with Chromium (the standard web browser) in Quest, Pico and other XR devices. It will likely also work with Wolvik in Quest, Pico and other XR devices.

Movement in the basic example

Let’s add movement in the scene, using the available controllers in each device: arrow keys or wasd keys in desktop, touching the screen with a finger in mobile, gamepad controls in XR devices. For that, we need to use a third party module, aframe-extras, which is imported in the header, right after the A-Frame module:

<script src="https://cdn.jsdelivr.net/gh/c-frame/aframe-extras@7.2.0/dist/aframe-extras.min.js"></script>

And then, we need a camera, and a camera rig:

<a-entity movement-controls="fly: true">
    <a-entity camera look-controls wasd-controls position="0 1.6 0"></a-entity>
</a-entity>

See the complete scene, based on the basic example: