2b4361cc133baec9eadda68ee4375764348b3efa
[occt.git] / tests / v3d / light_source / headlight
1 puts "================================="
2 puts "0031704: Visualization - add an interactive object AIS_LightSource representing a light source"
3 puts "================================="
4
5 pload MODELING VISUALIZATION
6 vclear
7 vinit View1
8 vlight -clear
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
15 vfit
16
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
22
23 puts "=== Check headlight option with positional light ==="
24 vlight -remove 1
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