Titania X3D Editor

Bring Colours to Your Life.

Titania v4.3.1

Bring Colours to Your Life.

X3D Reference

Adding backgrounds

Motivation

  • Shapes form the foreground of your scene
  • You can add a background to provide context

Backgrounds describe:

  • Sky and ground colors
  • Panorama images of mountains, cities, etc

Backgrounds are faster to draw than if you used shapes to build them.

Using the background components

A background creates three special shapes:

  • A sky sphere
  • A ground hemisphere inside the sky sphere
  • A panorama box inside the ground hemisphere

How does the background look like:

  • The sky sphere and ground hemisphere are shaded with a color gradient.
  • The panorama box is texture mapped with six images.
  • Transparent parts of the ground hemisphere reveal the sky sphere
  • Transparent parts of the panorama box reveal the ground and sky
  • The viewer can look up, down, and side-to-side to see different parts of the background
  • The viewer can never get closer to the background

Syntax: Background

A Background node describes background colors;

  • skyColor and skyAngle - sky gradation
  • groundColor and groundAngle - ground gradation

XML Encoding

Classic Encoding

Using sky angles and colors

  • The first sky color is at the north pole
  • The remaining sky colors are at given sky angles
    • The maximum angle is 180 degrees = 3.1415 radians (π)
  • The last color smears on down to the south pole

Using ground angles and colors

  • The first ground color is at the south pole
  • The remaining ground colors are at given ground angles
    • The maximum angle is 90 degrees = 1.5708 radians (π/2)
  • After the last color, the rest of the hemisphere is transparent

A sample background

XML Encoding

Classic Encoding

Example

Syntax: Background

A Background node describes background images:

  • frontUrl, etc - texture image URLs for box

XML Encoding

Classic Encoding

A sample background image

Color portion of clouds texture Transparency portion of clouds texture

A sample background

XML Encoding

Classic Encoding

Example

Summary

Backgrounds describe:

  • Ground and sky color gradients on ground hemisphere and sky sphere
  • Panorama images on a panorama box

The viewer can look around, but never get closer to the background.