summaryrefslogtreecommitdiffstats
path: root/ds9/library/3d.tcl
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2019-03-28 17:21:56 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2019-03-28 17:21:56 (GMT)
commitd4f075b2478675a09ccb6eb1a4821fc014c3478c (patch)
treea9bd6acdfcc2cd93c2f67660a8601b4293b83dbb /ds9/library/3d.tcl
parent10ff8b29691bbb6e20230326c722115eb1a57f68 (diff)
downloadblt-d4f075b2478675a09ccb6eb1a4821fc014c3478c.zip
blt-d4f075b2478675a09ccb6eb1a4821fc014c3478c.tar.gz
blt-d4f075b2478675a09ccb6eb1a4821fc014c3478c.tar.bz2
add 3d mouse mode
Diffstat (limited to 'ds9/library/3d.tcl')
-rw-r--r--ds9/library/3d.tcl55
1 files changed, 55 insertions, 0 deletions
diff --git a/ds9/library/3d.tcl b/ds9/library/3d.tcl
index df5fd8e..f3a9f99 100644
--- a/ds9/library/3d.tcl
+++ b/ds9/library/3d.tcl
@@ -367,6 +367,61 @@ proc Lock3DView {which} {
}
}
+proc 3DMotion {which x y} {
+ global canvas
+ global threed
+
+ set threed(az) [expr -(double($x)/$canvas(width) - .5) *2*90]
+ set threed(el) [expr (double($y)/$canvas(height) - .5) *2*90]
+ if {$threed(az) < -90} {
+ set threed(az) -90
+ }
+ if {$threed(az) > 90} {
+ set threed(az) 90
+ }
+ if {$threed(el) < -90} {
+ set threed(el) -90
+ }
+ if {$threed(el) > 90} {
+ set threed(el) 90
+ }
+
+ $which 3d view $threed(az) $threed(el)
+ Lock3DView $which
+}
+
+proc 3DDouble {which} {
+ global threed
+
+ set threed(az) 0
+ set threed(el) 0
+
+ $which 3d view $threed(az) $threed(el)
+ Lock3DView $which
+}
+
+proc 3DArrowKey {which az el} {
+ global threed
+
+ set threed(az) [expr $threed(az) + $az]
+ set threed(el) [expr $threed(el) + $el]
+ if {$threed(az) < -180} {
+ set threed(az) -180
+ }
+ if {$threed(az) > 180} {
+ set threed(az) 180
+ }
+ if {$threed(el) < -90} {
+ set threed(el) -90
+ }
+ if {$threed(el) > 90} {
+ set threed(el) 90
+ }
+
+ $which 3d view $threed(az) $threed(el)
+ Lock3DView $which
+}
+
# Prefs
proc PrefsDialog3d {} {