Tempusxr Français
Menu
  1. Docs
  2. Features

Portal guide

A portal is a doorway that shows another world. It stands on your floor (or in a poster), you look through it, and with world tracking you can walk through it: the world fills the screen, and turning the phone looks round it. Walk back out and the real room returns. From inside, the doorway is a hole in the world: look back through it and you see the real room.

Try it from the Experience Library: A doorway on the floor (Android with Chrome) and A window in a poster (any phone).

In a scene file

A portal is an asset, and a node shows it on an anchor. Its world is a 360 photo or a 3D room.

{
  "assets": [
    { "id": "savanna", "type": "image", "src": "savanna.jpg", "projection": "equirect" },
    { "id": "door", "type": "portal", "world": "savanna", "width": 1, "height": 2,
      "frame": { "color": "#c9a45c", "thickness": 0.06 } }
  ],
  "nodes": [{ "id": "gate", "asset": "door", "anchor": "spot" }],
  "behaviors": [
    { "on": "enter", "from": "gate", "do": "show", "node": "welcome" },
    { "on": "exit", "from": "gate", "do": "hide", "node": "welcome" }
  ]
}
FieldWhat it does
worldThe asset behind the doorway: an image with "projection": "equirect" (a 360 photo, twice as wide as high), or a model (a room).
width, heightThe size of the opening, in the units of the tracker: meters for world tracking, picture widths for an image target. Defaults 1 and 2.
frameA border around the opening, color and thickness. Without it, the opening has no frame.
worldScaleScales the world. 1 keeps a model in its own units. For a poster, a small value such as 0.05 shrinks the world to fit.
backgroundThe color of the sky around a model world. A 360 photo needs none.

The doorway stands on the anchor: the middle of its bottom edge is the node's position, it faces +Z, and the world lies behind it, along -Z. Build a room model with its door in the plane z = 0, the floor at y = 0 and the room going back into -Z. Anything that sticks out in front of the doorway is cut.

Two ways to use it

Without AR (iPhone, for now) a world scene with a viewer shows the world in the 3D viewer, with no doorway, so people can look round it.

Good to know