Ignore:
Timestamp:
Nov 17, 2008 2:18:41 PM (15 years ago)
Author:
gah
Message:

Add pan command to nanovis and pymolproxy

Location:
trunk/packages/vizservers
Files:
3 edited

Legend:

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

    r1215 r1219  
    694694
    695695static int
    696 CameraPanOp(ClientData cdata, Tcl_Interp *interp, int objc,
     696CameraEyeOp(ClientData cdata, Tcl_Interp *interp, int objc,
    697697             Tcl_Obj *const *objv)
    698698{
    699     double dx, dy, dz;
    700     if ((Tcl_GetDoubleFromObj(interp, objv[2], &dx) != TCL_OK) ||
    701         (Tcl_GetDoubleFromObj(interp, objv[3], &dy) != TCL_OK) ||
    702         (Tcl_GetDoubleFromObj(interp, objv[4], &dz) != TCL_OK)) {
    703         return TCL_ERROR;
    704     }
    705     NanoVis::cam->aim(dx, dy, dz);
    706     NanoVis::cam->x(dx);
    707     NanoVis::cam->y(dy);
    708     NanoVis::cam->z(dz);
     699    float x, y, z;
     700    if ((GetFloatFromObj(interp, objv[2], &x) != TCL_OK) ||
     701        (GetFloatFromObj(interp, objv[3], &y) != TCL_OK) ||
     702        (GetFloatFromObj(interp, objv[4], &z) != TCL_OK)) {
     703        return TCL_ERROR;
     704    }
     705    NanoVis::cam->x(x);
     706    NanoVis::cam->y(y);
     707    NanoVis::cam->z(z);
    709708    return TCL_OK;
    710709}
     
    714713            Tcl_Obj *const *objv)
    715714{
    716     double x, y, z;
    717     if ((Tcl_GetDoubleFromObj(interp, objv[2], &x) != TCL_OK) ||
    718         (Tcl_GetDoubleFromObj(interp, objv[3], &y) != TCL_OK) ||
    719         (Tcl_GetDoubleFromObj(interp, objv[4], &z) != TCL_OK)) {
     715    float x, y, z;
     716    if ((GetFloatFromObj(interp, objv[2], &x) != TCL_OK) ||
     717        (GetFloatFromObj(interp, objv[3], &y) != TCL_OK) ||
     718        (GetFloatFromObj(interp, objv[4], &z) != TCL_OK)) {
    720719        return TCL_ERROR;
    721720    }
     
    753752    {"aim",     2, CameraAimOp,      5, 5, "x y z",},
    754753    {"angle",   2, CameraAngleOp,    5, 5, "xAngle yAngle zAngle",},
    755     {"pan",     1, CameraPanOp,      5, 5, "x y z",},
     754    {"eye",     1, CameraEyeOp,      5, 5, "x y z",},
    756755    {"zoom",    1, CameraZoomOp,     3, 3, "factor",},
    757756};
  • trunk/packages/vizservers/nanovis/nanovis.cpp

    r1215 r1219  
    170170// Variables for mouse events
    171171
    172 // Object rotation angles
    173 const float def_rot_x = 90.;
    174 const float def_rot_y = 180.;
    175 const float def_rot_z = -135;
    176 
    177 // Object translation location from the origin
    178 const float def_obj_x = -0.0;
    179 const float def_obj_y = -0.0;
    180 const float def_obj_z = -2.5;
     172// Default camera rotation angles.
     173const float def_rot_x = 90.0f;
     174const float def_rot_y = 180.0f;
     175const float def_rot_z = -135.0f;
     176
     177// Default camera target.
     178const float def_target_x = 0.0f;
     179const float def_target_y = 0.0f;
     180const float def_target_z = 100.0f;
     181
     182// Default camera location.
     183const float def_eye_x = -0.0f;
     184const float def_eye_y = -0.0f;
     185const float def_eye_z = -2.5f;
    181186
    182187
     
    877882   //create the camera with default setting
    878883   cam = new NvCamera(0, 0, win_width, win_height,
    879                       def_obj_x, def_obj_y, def_obj_z,
    880                       0., 0., 100.,
    881                       def_rot_x, def_rot_y, def_rot_z);
     884                      def_eye_x, def_eye_y, def_eye_z,          /* location. */
     885                      def_target_x, def_target_y, def_target_z, /* target. */
     886                      def_rot_x, def_rot_y, def_rot_z);         /* angle. */
    882887
    883888   glEnable(GL_TEXTURE_2D);
  • trunk/packages/vizservers/pymolproxy/pymolproxy.c

    r1215 r1219  
    11391139    proxyPtr->invalidate_cache = 1;
    11401140    if (x != 0.0) {
    1141         Send(proxyPtr,"move x,%f\n", x * 0.005);
     1141        Send(proxyPtr,"move x,%f\n", x * 0.05);
    11421142    }   
    11431143    if (y != 0.0) {
    1144         Send(proxyPtr,"move y,%f\n", -y * 0.005);
     1144        Send(proxyPtr,"move y,%f\n", -y * 0.05);
    11451145    }   
    11461146    return proxyPtr->status;
Note: See TracChangeset for help on using the changeset viewer.