0029528: Visualization, TKOpenGl - allow defining sRGB textures
[occt.git] / tests / v3d / glsl / cullsize
1 puts "========"
2 puts "0029295: Visualization, TKOpenGl - provide distance culling option"
3 puts "Check size culling"
4 puts "========"
5
6 set THE_NB_BOXES 5
7 set THE_COLORS { RED GREEN BLUE YELLOW PURPLE1 }
8 set THE_PICK_PNTS1O { {  10 165 } { 100 200 } { 170 250 } { 250 250 } { 350 300 } }
9 set THE_PICK_PNTS1P { {  40 170 } { 100 200 } { 170 250 } { 250 250 } { 380 350 } }
10 set THE_PICK_PNTS2O { { 148 192 } { 175 200 } { 190 200 } { 200 220 } { 250 230 } }
11 set THE_PICK_PNTS2P { { 152 192 } { 175 200 } { 190 200 } { 220 220 } { 250 230 } }
12 set THE_PICK_PNTS3P { {  90 155 } { 105 160 } { 125 170 } { 140 175 } { 160 180 } }
13
14 pload MODELING VISUALIZATION
15 vclear
16 vinit View1
17 vaxo
18 for { set x 1 } { $x <= $THE_NB_BOXES } { incr x } { box b$x [expr $x * 1.0] 0 0 [expr $x * 0.2] [expr $x *0.1] [expr $x *0.3]; vdisplay -dispMode 1 b$x }
19 for { set x 1 } { $x <= $THE_NB_BOXES } { incr x } { vsetcolor b$x [lindex $THE_COLORS [expr $x - 1]] }
20 vline l 1 0 0 6 0 0
21 vdisplay -mutable l
22 vcamera -ortho
23 vfit
24
25 vzlayer default -cullsize 25
26 vcamera -ortho
27 for { set x 0 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS1O $x] rgb name] == "BLACK" } { puts "Error: object $x is culled" } }
28 vdump $::imagedir/${::casename}_25o.png
29 vcamera -persp
30 for { set x 0 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS1P $x] rgb name] == "BLACK" } { puts "Error: object $x is culled" } }
31 vdump $::imagedir/${::casename}_25p.png
32
33 vzlayer default -cullsize 50
34 vcamera -ortho
35 for { set x 1 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS1O $x] rgb name] == "BLACK" } { puts "Error: object $x is culled" } }
36 for { set x 0 } { $x < 1 }             { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS1O $x] rgb name] != "BLACK" } { puts "Error: object $x is NOT culled" } }
37 vdump $::imagedir/${::casename}_50o.png
38 vcamera -persp
39 for { set x 1 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS1P $x] rgb name] == "BLACK" } { puts "Error: object $x is culled" } }
40 for { set x 0 } { $x < 1 }             { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS1P $x] rgb name] != "BLACK" } { puts "Error: object $x is NOT culled" } }
41 vdump $::imagedir/${::casename}_50p.png
42
43 vzoom 0.25
44 vzlayer default -cullsize 30
45 vcamera -ortho
46 for { set x 2 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS2O $x] rgb name] == "BLACK" } { puts "Error: object $x is culled" } }
47 for { set x 0 } { $x < 2 }             { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS2O $x] rgb name] != "BLACK" } { puts "Error: object $x is NOT culled" } }
48 vdump $::imagedir/${::casename}_30o.png
49 vcamera -persp
50 for { set x 2 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS2P $x] rgb name] == "BLACK" } { puts "Error: object $x is culled" } }
51 for { set x 0 } { $x < 2 }             { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS2P $x] rgb name] != "BLACK" } { puts "Error: object $x is NOT culled" } }
52 vdump $::imagedir/${::casename}_30p.png
53
54 vviewparams -eye 16.8333 -9.08333 10.0833 -at 7.5 0.25 0.75
55 for { set x 3 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS3P $x] rgb name] == "BLACK" } { puts "Error: object $x is culled" } }
56 for { set x 0 } { $x < 3 }             { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS3P $x] rgb name] != "BLACK" } { puts "Error: object $x is NOT culled" } }
57 vdump $::imagedir/${::casename}_30p2.png