Changeset 1237 for trunk


Ignore:
Timestamp:
Nov 25, 2008, 10:01:15 AM (16 years ago)
Author:
gah
Message:
 
Location:
trunk
Files:
3 edited

Legend:

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

    r1229 r1237  
    167167        psi     0
    168168        zoom    1.0
    169         x       0
    170         y       0
    171         z       0
     169        dx      0
     170        dy      0
    172171    }
    173172    set _obj2id(count) 0
     
    11721171                psi 0
    11731172                zoom 1.0
     1173                dx 0
     1174                dy 0
    11741175            }
    11751176            set xyz [Euler2XYZ $view_(theta) $view_(phi) $view_(psi)]
    11761177            _send "camera angle $xyz"
     1178            _send "camera pan $view_(dx) $view_(dy)"
    11771179        }
    11781180    }
     
    12721274    # Experimental stuff
    12731275    if { $option == "set" } {
    1274         set view_(x) $x
    1275         set view_(y) $y
    1276         _send "camera pan $view_(x) $view_(y)"
     1276        set view_(dx) $x
     1277        set view_(dy) $y
     1278        _send "camera pan $view_(dx) $view_(dy)"
    12771279        return
    12781280    }
     
    12811283    }
    12821284    if { $option == "drag" || $option == "release" } {
    1283         set view_(x) [expr $view_(x) + $x]
    1284         set view_(y) [expr $view_(y) + $y]
    1285         _send "camera pan $view_(x) $view_(y)"
     1285        set view_(dx) [expr $view_(dx) + $x]
     1286        set view_(dy) [expr $view_(dy) + $y]
     1287        _send "camera pan $view_(dx) $view_(dy)"
    12861288    }
    12871289    if { $option == "release" } {
  • trunk/packages/vizservers/nanovis/Command.cpp

    r1236 r1237  
    727727             Tcl_Obj *const *objv)
    728728{
    729     float x, y;
    730     if ((GetFloatFromObj(interp, objv[2], &x) != TCL_OK) ||
    731         (GetFloatFromObj(interp, objv[3], &y) != TCL_OK)) {
     729    int x, y;
     730    if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) ||
     731        (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
    732732        return TCL_ERROR;
    733733    }
  • trunk/packages/vizservers/nanovis/nanovis.cpp

    r1236 r1237  
    444444
    445445static void
    446 NanoVis::pan(int dx, int dy)
     446NanoVis::pan(int x, int y)
    447447{
    448448    float x, y;
     
    456456    fprintf(stderr, "x=%f, y=%f\n", x, y);
    457457   
    458     cam->x(cam->x() + x);
    459     cam->y(cam->y() + y);
     458    cam->x(def_eye_x + x);
     459    cam->y(def_eye_y + y);
    460460    fprintf(stderr, "set eye to %f %f\n", cam->x(), cam->y());
    461461
    462     cam->xAim(cam->xAim() + x);
    463     cam->yAim(cam->yAim() + y);
     462    cam->xAim(def_target_x + x);
     463    cam->yAim(def_target_y + y);
    464464    fprintf(stderr, "set aim to %f %f\n", cam->xAim(), cam->yAim());
    465465}
Note: See TracChangeset for help on using the changeset viewer.