Spotlight Tutorial

Description

Light objects allow members to create dynamically lit colorful scenes. Any object can be turned into a light source, by defining light properties in the Twml descriptions.
Members can switched lights on and off and can edit the light properties color, distance and softness.
There are two types of lights: spot lights and point lights. This example shows a spot light.

Twml options

In the Twml document you define
  • The type of the light source (type="spot" vs. type="point")
  • The color of the light (e.g. color="#00FF00")
  • The position relative to the object
For spotlights only, you have to define in addition:
  • The direction of the light (defined by a second point the light is directed two)
  • The Falloff angle of the light in degrees (e.g. falloff_angle="90")
  • The Radius of the light in meter (e.g. radius="3")

Twml example

<package caption="Green Lamp" icon="icon.jpg">
    <description>A green spot light</description>
    <object path="spotlight.dae">
        <light type="spot" 
            color="#00FF00" 
            falloff_angle="180.0"
            radius="3.0" 
            position="0.041404 0.472029 0"
            direction="0.0 1.0 0.0" />
    </object>
</package>

Preview