Changeset 1238 for trunk/packages
- Timestamp:
- Nov 25, 2008, 10:08:15 AM (16 years ago)
- Location:
- trunk/packages/vizservers/nanovis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/Command.cpp
r1237 r1238 727 727 Tcl_Obj *const *objv) 728 728 { 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)) { 732 732 return TCL_ERROR; 733 733 } -
trunk/packages/vizservers/nanovis/nanovis.cpp
r1237 r1238 444 444 445 445 static 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 446 NanoVis::pan(float dx, float dy) 447 { 454 448 /* Move the camera and its target by equal amounts along the x and y 455 449 * axes. */ 456 fprintf(stderr, "x=%f, y=%f\n", x,y);450 fprintf(stderr, "x=%f, y=%f\n", dx, dy); 457 451 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); 460 454 fprintf(stderr, "set eye to %f %f\n", cam->x(), cam->y()); 461 455 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); 464 458 fprintf(stderr, "set aim to %f %f\n", cam->xAim(), cam->yAim()); 465 459 } -
trunk/packages/vizservers/nanovis/nanovis.h
r1215 r1238 169 169 static void xinetd_listen(void); 170 170 static int render_2d_contour(HeightMap* heightmap, int width, int height); 171 static void pan(float dx, float dy); 171 172 172 173 #ifndef XINETD
Note: See TracChangeset
for help on using the changeset viewer.