- Docs
- Get started
Your first experience in five minutes
You need a text editor, a phone, and a place to put one HTML file on HTTPS (a phone camera works only on HTTPS). No install.
1. Take a picture to track. For a first try use ours: open https://tempusxr.vercel.app/starter/poster.png on a computer screen (or print it). Its target file is https://tempusxr.vercel.app/starter/poster.txr. For your own picture, see section 5.
2. Write the page. Save this as index.html:
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="https://aframe.io/releases/1.8.0/aframe.min.js"></script>
<script src="https://tempusxr.vercel.app/v1/tempusxr-aframe.min.js"></script>
<script src="https://tempusxr.vercel.app/v1/tempusxr-image.min.js"></script>
</head>
<body>
<a-scene
tempusxr="tracker: image; targets: https://tempusxr.vercel.app/starter/poster.txr"
renderer="alpha: true"
vr-mode-ui="enabled: false"
>
<a-camera look-controls="enabled: false" wasd-controls="enabled: false"></a-camera>
<a-light type="ambient" intensity="1.2"></a-light>
<a-entity tempusxr-image-target="index: 0">
<a-box position="0 0 0.15" scale="0.3 0.3 0.3" color="#fecb02"></a-box>
</a-entity>
</a-scene>
</body>
</html>
3. Put it online. Any static host works. The quickest: drag the folder onto Netlify Drop, or use GitHub Pages or Vercel. You get an https:// address.
4. Open it on the phone, allow the camera, and point it at poster.png on the other screen. A yellow box sticks to the poster. If it does not, add ?test to the address and read the Test console (section 8).
5. Make it yours. Replace the box with anything inside the tempusxr-image-target entity: <a-video>, <a-image>, <a-gltf-model>, text. Then make your own target file (section 5).
The same page with Three.js is in Install the SDK. A whole experience from a JSON file, with no code, is the next page: Your first scene file.