Changeset 2219 for trunk


Ignore:
Timestamp:
Apr 21, 2011 7:24:19 PM (13 years ago)
Author:
gah
Message:

add changes to drawing3d and vtkviewer for vtk render server

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/vtkviewer2.tcl

    r2216 r2219  
    9191    private method IsValidObject { dataobj }
    9292
     93    private variable _arcball ""
    9394    private variable _outbuf       ;# buffer for outgoing commands
    9495
     
    159160        y2 -1
    160161    }
     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]
    161165
    162166    # Initialize the view to some default parameters.
     
    341345    image delete $_image(download)
    342346    array unset _settings $this-*
     347    blt::arcball destroy $_arcball
    343348}
    344349
     
    357362    set _width $w
    358363    set _height $h
     364    $_arcball resize $w $h
    359365    if { !$_resizePending } {
    360366        $_dispatcher event -after 100 !resize
     
    923929            set _settings($this-zoom)  $_view(zoom)
    924930            SendCmd "camera reset all"
     931            $_arcball reset
    925932        }
    926933    }
     
    973980                    return
    974981                }
    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
    980984                }
    981                 SendCmd "camera orient $_click(q1)"
     985                set q [$_arcball rotate $x $y $_click(x) $_click(y)]
     986                SendCmd "camera orient $q"
    982987                #SendCmd "camera orient $q"
     988                puts stderr "rotate q=$q"
     989                puts stderr "arcball matrix=[$_arcball matrix]"
     990                puts stderr "arcball quaternion=[$_arcball quaternion]"
    983991                set _click(x) $x
    984992                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]
    988993            }
    989994        }
Note: See TracChangeset for help on using the changeset viewer.