Prepare a 3D model, anchor it to a printed marker and publish the experience so readers can open it from a QR code.

Rudo Studios · 2026-11-10

A phone frames a square marker and displays a three-dimensional model on top of it

Point a phone at a printed card. A scale model appears on the screen, sitting on the card and changing perspective as the phone moves. To build this experience, you need a 3D model, a scene that recognizes a marker through the camera and an HTTPS address for sharing the scene.

To follow along, model a simple pavilion with a rectangular base, four columns and a roof. Start with a cube if you're learning the workflow. That lets you check camera access and marker tracking before introducing materials, scale and more complex geometry.

1. Prepare a lightweight copy of the 3D model

  1. Duplicate your working file. Make changes to the copy so you keep the complete model.
  2. Keep the geometry people will see. If viewers only need the exterior, remove hidden partitions, interior furniture and details too small to read on a phone. If people will explore the interior, keep the features that help them understand it.
  3. Check faces, materials and the origin. Point normals outward. Place the model origin at the center of its base, at floor level. This makes it easier to line up the model with the card. Use simple materials and reduce large textures before export.
  4. Export as glTF Binary (.glb). Include only the selected objects and check that the textures are embedded. If your modeling software cannot export GLB, use a compatible intermediate format such as FBX and convert it in Blender. Compare the exported model with the original to spot changes in scale, materials or axes. PlayCanvas supported formats

Two views of the same pavilion. The first shows partitions and furniture, and the second keeps the base, columns and roof.

You can import the GLB directly into the editor. If you already have a model on Sketchfab, you can also find it under Assets → Asset Store → Sketchfab. Check the license and attribution requirements before redistributing someone else's model. PlayCanvas Asset Store

2. Run your first test in PlayCanvas

  1. Open the marker-based AR Starter Kit and use Fork to copy it into your account. The WebXR AR Starter Kit listed under new projects uses a different setup. Look for the scene with AR Camera, Pattern Marker and Orange Box in its hierarchy. If you cannot fork the older project or open its scene, use the HTML example in the next section. How to fork a PlayCanvas project
  2. Open the Editor and click Launch before editing the scene. Allow camera access and point the camera at the Hiro marker. The sample box should appear when the whole marker is in view. If it does not, troubleshoot camera access or tracking before importing the model. AR.js marker documentation
  3. Drag the GLB into Assets. When the import finishes, drag the generated Template asset into the hierarchy under Pattern Marker. The model must be a child of the marker so it follows the marker's position and rotation. Disable Orange Box as you compare the two. Importing models into PlayCanvas
  4. Select the model entity. Adjust its Scale uniformly, then its Rotation, then its Position. If it imports much too large, try 0.1 on all three axes as a starting point. Use a decimal point in the editor. If the model looks buried in the card, check its origin and adjust its local position.

PlayCanvas Hierarchy panel with Orange Box indented beneath Pattern Marker.

3. Run the same test with HTML and AR.js

This example opens the camera and shows a cube when it recognizes Hiro. Save it as index.html in its own folder. To test on a computer, run python -m http.server 8000 in that folder and open http://localhost:8000/. To test on a phone, deploy the folder to a static host over HTTPS. Your computer's localhost is an exception to the HTTPS requirement. Opening the computer's local-network IP over HTTP generally prevents the phone's browser from accessing its camera. AR.js · Camera permissions

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Augmented reality test</title>
  <script src="https://aframe.io/releases/1.6.0/aframe.min.js"></script>
  <script src="https://raw.githack.com/AR-js-org/AR.js/3.4.8/aframe/build/aframe-ar.js"></script>
</head>
<body style="margin: 0; overflow: hidden">
  <a-scene embedded vr-mode-ui="enabled: false"
           arjs="sourceType: webcam; debugUIEnabled: false">
    <a-marker preset="hiro">
      <a-box position="0 0.25 0" width="0.5" height="0.5" depth="0.5"
             color="#23a78b"></a-box>
    </a-marker>
    <a-entity camera></a-entity>
  </a-scene>
</body>
</html>

A green cube rendered over the tilted Hiro marker.

Once the cube works, put modelo.glb in the same folder. Replace the <a-box> element with <a-entity gltf-model="url(./modelo.glb)" scale="0.1 0.1 0.1"></a-entity>. Adjust the scale after seeing the model. If the scene goes blank, put the cube back to confirm the marker still works and check that the GLB URL opens in your browser. A-Frame glTF component

4. Make and connect your own marker

  1. Draw a square image with large, dark shapes on a light background. Give the design an asymmetrical layout so the top, bottom, left and right are distinguishable. Leave space between the artwork and the edge.
  2. Open AR.js Marker Training, choose Upload and select the artwork. Keep Pattern Ratio at 0.50 for the first test and use a black border. The tool adds the tracking frame around your design.
  3. Use Download Marker to save the .patt and Download Image to save the finished image. Give them matching names such as pavilhao.patt and pavilhao.png. Print the generated image on matte paper with a white margin around it. Keep its proportions and the entire border.
  4. In PlayCanvas, select Pattern Marker. Find the asset picker under Script → arMarker → Pattern. Upload the .patt to Assets and assign it to Pattern. If Launch still recognizes Hiro, check which file is assigned and reload the test.
  5. In HTML, put pavilhao.patt next to index.html. Replace the opening marker tag with <a-marker type="pattern" url="./pavilhao.patt">. The contents inside it stay in place. For multiple markers, give each one its own design, .patt file and entity. Test each card on its own before putting them side by side.

An asymmetrical design gains a dark border. The process produces a PNG and a PATT file.

5. Test on a phone and change one variable at a time

Place the card on a flat, well-lit table. Start with the camera facing the card almost straight on. Move sideways, tilt the phone and deliberately take the card out of frame. The model should return to the marker when it comes back into view. Check how the physical size of the card relates to the model before settling on a scale. If your project requires real-world dimensions, calibrate the scene against an object of known size.

Three camera views show the marker straight on, rotated and partly out of frame.

Symptom Check this first
The camera does not open Open the HTTPS URL directly in the phone's browser, check camera permissions and close other apps using the camera.
Hiro works but the custom card fails Make sure the PNG and .patt came from the same generator session, the right file is assigned and the full border is visible without glare.
The cube appears but the model does not Check that the GLB loaded, that the entity is under the marker and that its scale or position did not place it out of view.
The model spins or jitters Try a more asymmetrical design, even lighting and a larger marker. Keep the whole frame in view.
The page takes too long to load Test over mobile data. Reduce texture sizes and invisible geometry, then compare the time until the model appears.

6. Publish the link and assemble the printed card

In PlayCanvas, open Publishing → Publish on PlayCanvas, select the right scene and publish the build. Open the build link for testing. Once it is ready, set it as the Primary Build and share the project link at https://playcanv.as/p/YOUR_PROJECT_ID/. In the HTML workflow, host index.html, modelo.glb and the .patt in the same HTTPS folder. Publishing a PlayCanvas build

Put a QR code that opens the published URL and a marker that positions the model on the card. Generate the QR code from the public URL, download the PNG or SVG and scan a printed proof to check where it leads. Give the QR code and the marker their own space and print a short URL too. On the card, write Scan the QR code, allow camera access and point at the marker. QR code generator Test the final printed card on representative Android and iOS devices using the link without signing in. Include a static image of the model on a companion page for people without a camera or with an incompatible device.

Printed card layout with a space for the QR code on the left and the tracking marker on the right.

Tutorial by Rudo Studios, adapted from Matheus Rudo Oliveira's workshop materials with AI editorial assistance. Diagrams and AR.js test capture by Rudo Studios. PlayCanvas detail from the workshop materials.

Ver em português