Introduction to 3D Graphics and VRML

[ Previous | Index | Next ]


Lighting

Lighting sources can be...

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

VRML Lighting Example

#VRML V1.0 ascii

DirectionalLight {
  on        TRUE       # Boolean
  intensity 0.7        # Float
  color     1   1    1 # RGB Color
  direction 0   0.5 -1 # Vector
}

...

PointLight {
  on        TRUE      # Boolean
  intensity 0.7       # Float
  color     0   0   1 # RGB Color
  location  5   5   0 # Vector
}

...

SpotLight {
  on        TRUE      # Boolean
  intensity 0.8       # Float
  color     1   0  0  # RGB Color
  location  5  -1  0  # Vector
  direction -1  0  0  # Vector
  dropOffRate  0      # Float
  cutOffAngle  0.5    # Float
}

Author: Michael Louka (mlouka@sn.no)
Last Updated: 19 November 1996