1 puts "================================="
2 puts "0031704: Visualization - add an interactive object AIS_LightSource representing a light source"
3 puts "================================="
5 pload MODELING VISUALIZATION
9 vbackground -color GRAY
10 vrenderparams -shadingModel PHONG
11 vlight -add ambient -COLOR WHITE -intensity 0.1
12 box b 10 10 10 30 30 30
13 vdisplay b -dispMode 1
14 vaspects b -material Brass
17 puts "=== Check headlight option with spotlight ==="
18 vlight -add spotlight -dir 0 0 -1 -head 1 -intensity 1000000000 -color GREEN -display aSpotlight
19 set aColor1 [vreadpixel 200 200 rgb name]
20 if { "$aColor1" != "GREEN" } { puts "Error: expected color near the light is GREEN" }
21 vdump $imagedir/${casename}_spot.png
23 puts "=== Check headlight option with positional light ==="
25 vlight -add positional -head 1 -color RED -display aPosLight
26 set aColor2 [vreadpixel 200 200 rgb name]
27 if { "$aColor2" != "RED" } { puts "Error: expected color near the light is RED" }
28 vdump $imagedir/${casename}_pos.png