- Timestamp:
- Apr 21, 2011, 7:24:19 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkviewer2.tcl
r2216 r2219 91 91 private method IsValidObject { dataobj } 92 92 93 private variable _arcball "" 93 94 private variable _outbuf ;# buffer for outgoing commands 94 95 … … 159 160 y2 -1 160 161 } 162 set _arcball [blt::arcball create 100 100] 163 $_arcball matrix { 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 } 164 puts stderr start=[$_arcball quaternion] 161 165 162 166 # Initialize the view to some default parameters. … … 341 345 image delete $_image(download) 342 346 array unset _settings $this-* 347 blt::arcball destroy $_arcball 343 348 } 344 349 … … 357 362 set _width $w 358 363 set _height $h 364 $_arcball resize $w $h 359 365 if { !$_resizePending } { 360 366 $_dispatcher event -after 100 !resize … … 923 929 set _settings($this-zoom) $_view(zoom) 924 930 SendCmd "camera reset all" 931 $_arcball reset 925 932 } 926 933 } … … 973 980 return 974 981 } 975 set q [blt::arcball rotate $w $h $_click(x) $_click(y) $x $y] 976 if { [info exists _click(q1)] } { 977 set _click(q1) [blt::arcball combine $_click(q1) $q] 978 } else { 979 set _click(q1) $q 982 if { $dx == 0 && $dy == 0 } { 983 return 980 984 } 981 SendCmd "camera orient $_click(q1)" 985 set q [$_arcball rotate $x $y $_click(x) $_click(y)] 986 SendCmd "camera orient $q" 982 987 #SendCmd "camera orient $q" 988 puts stderr "rotate q=$q" 989 puts stderr "arcball matrix=[$_arcball matrix]" 990 puts stderr "arcball quaternion=[$_arcball quaternion]" 983 991 set _click(x) $x 984 992 set _click(y) $y 985 puts stderr q=$_click(q1)986 puts stderr m1=[blt::arcball matrix $_click(q1)]987 puts stderr m2=[blt::arcball matrix $q]988 993 } 989 994 }
Note: See TracChangeset
for help on using the changeset viewer.