Changeset 1238 for trunk/packages


Ignore:
Timestamp:
Nov 25, 2008, 10:08:15 AM (16 years ago)
Author:
gah
Message:
 
Location:
trunk/packages/vizservers/nanovis
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/Command.cpp

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

    r1237 r1238  
    444444
    445445static void
    446 NanoVis::pan(int x, int y)
    447 {
    448     float x, y;
    449 
    450     /* Normalize coordinates */
    451     x = (float)dx / (float)win_width;
    452     y = (float)dy / (float)win_height;
    453 
     446NanoVis::pan(float dx, float dy)
     447{
    454448    /* Move the camera and its target by equal amounts along the x and y
    455449     * axes. */
    456     fprintf(stderr, "x=%f, y=%f\n", x, y);
     450    fprintf(stderr, "x=%f, y=%f\n", dx, dy);
    457451   
    458     cam->x(def_eye_x + x);
    459     cam->y(def_eye_y + y);
     452    cam->x(def_eye_x + dx);
     453    cam->y(def_eye_y + dy);
    460454    fprintf(stderr, "set eye to %f %f\n", cam->x(), cam->y());
    461455
    462     cam->xAim(def_target_x + x);
    463     cam->yAim(def_target_y + y);
     456    cam->xAim(def_target_x + dx);
     457    cam->yAim(def_target_y + dy);
    464458    fprintf(stderr, "set aim to %f %f\n", cam->xAim(), cam->yAim());
    465459}
  • trunk/packages/vizservers/nanovis/nanovis.h

    r1215 r1238  
    169169    static void xinetd_listen(void);
    170170    static int render_2d_contour(HeightMap* heightmap, int width, int height);
     171    static void pan(float dx, float dy);
    171172
    172173#ifndef XINETD
Note: See TracChangeset for help on using the changeset viewer.