- Timestamp:
- Nov 25, 2008 11:52:46 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/heightmapviewer.tcl
r1228 r1243 132 132 psi 0 133 133 zoom 1.0 134 xfocus 0 135 yfocus 0 136 zfocus 0 134 dx 0 135 dy 0 137 136 } 138 137 set obj2id_(count) 0 … … 796 795 psi 0 797 796 zoom 1.0 797 dx 0 798 dy 0 798 799 } 799 800 set xyz [Euler2XYZ $view_(theta) $view_(phi) $view_(psi)] 800 801 _send "camera angle $xyz" 802 _send "camera pan $view_(dx) $view_(dy)" 801 803 } 802 804 } … … 812 814 # controls for this widget. Changes the zoom for the current view. 813 815 # ---------------------------------------------------------------------- 814 itcl::body Rappture::HeightmapViewer::_pan {option x y} { 815 return 816 itcl::body Rappture::NanovisViewer::_pan {option x y} { 816 817 # Experimental stuff 818 set w [winfo width $itk_component(3dview)] 819 set h [winfo height $itk_component(3dview)] 817 820 if { $option == "set" } { 818 set dx $x 819 set dy $y 820 set view_( x) [expr $view_(x) + $dx]821 set view_( y) [expr $view_(y) + $dy]822 _send " pan $dx $dy"821 set x [expr $x / double($w)] 822 set y [expr $y / double($h)] 823 set view_(dx) [expr $view_(dx) + $x] 824 set view_(dy) [expr $view_(dy) + $y] 825 _send "camera pan $view_(dx) $view_(dy)" 823 826 return 824 827 } 825 828 if { $option == "click" } { 829 set click_(x) $x 830 set click_(y) $y 826 831 $itk_component(3dview) configure -cursor hand1 827 832 } 828 833 if { $option == "drag" || $option == "release" } { 829 set view_(x) [expr $view_(x) + $x] 830 set view_(y) [expr $view_(y) + $y] 831 _send "camera pan $view_(x) $view_(y) 0" 834 set dx [expr ($click_(x) - $x)/double($w)] 835 set dy [expr ($click_(y) - $y)/double($h)] 836 set click_(x) $x 837 set click_(y) $y 838 set view_(dx) [expr $view_(dx) - $dx] 839 set view_(dy) [expr $view_(dy) - $dy] 840 _send "camera pan $view_(dx) $view_(dy)" 832 841 } 833 842 if { $option == "release" } {
Note: See TracChangeset
for help on using the changeset viewer.