Titania X3D Editor

Bring Colours to Your Life.

Titania v4.3.6

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.

Cookies and other Technologies

By clicking »Accept« or continuing to use the site, you agree to the use of CREATE3000 and third-party cookies and other similar technologies to enhance your browsing experience, analyze and measure your engagement with our content, and provide more relevant ads on CREATE3000 websites and others. Learn more about cookies. You can withdraw your consent at any time.