#VRML V2.0 utf8 #
#[return] #

# ex-lightspot.wrl 
#     Example : spot lights
#     Defining and rendering a sphere using a spot light 

# Observer in (0,0,6) looking at (0,0,1)
Viewpoint {
	position 0 0 6
	orientation 0 0 1 0 
}

#a SpotLight means a light source which sends rays in 
# a direction within a solid angle
#ambientIntensity, varies 0 - 1 defining an additional ambient contribution
#attenuation a b c, defines an attenuation factor
#beamwidth radians (solid angle of maximum intensity)
#color r g b  , each component in the range 0-1 defining the light color
#cutOffAngle radians, define the outer bound of the solid angle
#direction x y z
#intensity 1, range 0-1
#location x y z
#on boolean, lit (TRUE) or unlit light
#radius n, zone of light influence (n is the zone radius)

#example : no-ambient,color=white,intensity .5,location z=2 ,lit, radius=100 
# Spot allow us to concentrate the light beam (compare to directional
#  or point light)
SpotLight{
   ambientIntensity 0
   attenuation 1 0 0 # no attenuation
# narrow beamwidth (default 1.57)
   beamWidth .1
   color 1 1 1 # white
# narrow cutOffAngle (default .785)
   cutOffAngle .1
   direction 0 0 -1
   intensity .2
   location  0 0 2
   on TRUE
   radius 100
}

# the sphere is defined green (specular) and located at (0,0,0)
# defines a Shape Node  and a surface material
  Shape{
	appearance Appearance {
			material Material {
                            ambientIntensity 0.2 # default
                            diffuseColor .4 .4 .4 #in order to see the sphere
                            shininess .5 # sharp                            
                            specularColor .0 .5 0
					}
		}
         	geometry Sphere{}
        }
#