1804bb99 |
1 | puts "========" |
2 | puts "OCC25833" |
3 | puts "========" |
4 | puts "" |
5 | ########################################## |
6 | ## Visualization, Ray Tracing - fix problems with the backside of triangles |
7 | ########################################## |
8 | |
9 | box b1 100 100 100 |
10 | explode b1 Fa |
11 | box b2 10 10 -20 10 10 10 |
12 | |
13 | vsetdispmode 1 |
14 | vdisplay b1_5 b1_6 b2 |
15 | vsetmaterial b1_5 steel |
16 | vsetmaterial b1_6 steel |
17 | vfit |
18 | |
19 | # Problem 1: b1_5 (grey) becomes semi-transparent after the next line, |
20 | # compare it with b1_6 visible from the frontside |
21 | vrenderparams -rayTrace |
22 | vdump ${imagedir}/${test_image}_1.png |
23 | checkcolor 100 300 0.37647059559822083 0.3803921639919281 0.40392157435417175 |
24 | if { ${stat} != 1 } { |
25 | puts "Error : bad color (case 1)" |
26 | } |
27 | |
28 | # Problem 2: The small box shows through b1_5 |
29 | vrenderparams -reflections |
30 | vdump ${imagedir}/${test_image}_2.png |
31 | checkcolor 190 250 0.37647059559822083 0.3803921639919281 0.40392157435417175 |
32 | if { ${stat} != 1 } { |
33 | puts "Error : bad color (case 2)" |
34 | } |
35 | |
36 | ttranslate b2 30 30 30 |
37 | # Problem 3: The small box is not reflected from the backface of b1_5 |
38 | vdisplay b2 |
39 | vdump ${imagedir}/${test_image}_3.png |
40 | checkcolor 190 260 0.79607844352722168 0.60784316062927246 0.21960784494876862 |
41 | if { ${stat} != 1 } { |
42 | puts "Error : bad color (case 3)" |
43 | } |
44 | checkcolor 190 310 0.61960786581039429 0.56078433990478516 0.43529412150382996 |
45 | if { ${stat} != 1 } { |
46 | puts "Error : bad color (case 4)" |
47 | } |