5 ##################################################################
6 puts "Visualization, TKV3d - implement individual acceleration data structure for selection of 2D persistent objects"
7 ##################################################################
12 vinit View1 w=$win_width h=$win_height
15 # Display several different presentation types with orthographic camera
20 box box2d_pos 100 100 1
21 box box2d_loc 100 100 1
22 box box_zoom 100 100 100
24 vdisplay box3d -dispMode 1 -highMode 0
25 vdisplay box2d -dispMode 1 -highMode 1 -2d center
26 vdisplay box2d_pos -dispMode 1 -highMode 1 -2d bottomLeft
27 vdisplay box2d_loc -dispMode 1 -highMode 1 -2d center
28 vdisplay box_zoom -dispMode 1 -highMode 0 -trsfPers zoom
30 vsetlocation box2d_loc 100 0 0
31 vsetlocation box_zoom -100 -100 100
33 vsetmaterial box3d box2d box2d_pos box2d_loc box_zoom PLASTIC
36 vsetcolor box2d_pos GREEN
37 vsetcolor box2d_loc GREEN
38 vsetcolor box_zoom RED
41 # ==========================================
42 # Test selection for orthographic projection
43 # ==========================================
45 set test_1 {220 120}; # box2d
46 set test_2 {350 150}; # box2d_pos
47 set test_3 { 50 350}; # box2d_loc
50 if {[vreadpixel {*}$test_1 name] != "CYAN1 1"} { puts "ERROR: zoom persistent box is not detected!" }
51 vdump $imagedir/${casename}_1.png
54 if {[vreadpixel {*}$test_2 name] != "CYAN1 1"} { puts "ERROR: zoom persistent box is not detected!" }
55 vdump $imagedir/${casename}_2.png
58 if {[vreadpixel {*}$test_3 name] != "CYAN1 1"} { puts "ERROR: zoom persistent box is not detected!" }
59 vdump $imagedir/${casename}_3.png
61 # =========================================
62 # Test selection for perspective projection
63 # =========================================
66 vcamera -distance 1000
67 set test_1 {220 120}; # box2d
68 set test_2 {350 150}; # box2d_pos
69 set test_3 { 50 350}; # box2d_loc
72 if {[vreadpixel {*}$test_1 name] != "CYAN1 1"} { puts "ERROR: zoom persistent box is not detected!" }
73 vdump $imagedir/${casename}_4.png
76 if {[vreadpixel {*}$test_2 name] != "CYAN1 1"} { puts "ERROR: zoom persistent box is not detected!" }
77 vdump $imagedir/${casename}_5.png
80 if {[vreadpixel {*}$test_3 name] != "CYAN1 1"} { puts "ERROR: zoom persistent box is not detected!" }
81 vdump $imagedir/${casename}_6.png