Introduction to 3D Graphics and VRML

[ Previous | Index | Next ]


Lighting

Light can be...

  • Ambient (background)
  • Directional
  • Point (Omni-directional)
  • Spot

VRML Lighting Example

#VRML V2.0 utf8
Group {
  children [
  
    ...
  
    DirectionalLight {
      on               TRUE 
      intensity        0.6
      ambientIntensity 0.0
      color            0.0 1.0  0.0
      direction        0.0 0.5 -1.0
    },
    PointLight {
      on               TRUE
      intensity        0.8
      color            0.0 0.0 1.0
      location         5.0 5.0 0.0
    },
    SpotLight {
      on               TRUE
      intensity        0.6
      color            1.0  0.0 0.0
      location         5.0 -2.0 0.0
      direction       -1.0  0.0 0.0
      cutOffAngle      0.5
    }
  ]
}


Author: Michael Louka (Michael.Louka@of.telia.no)
Last Updated: 31 October 1997