Automatic panning

Discussion in 'Microstation' started by Suneel, Nov 10, 2004.

  1. Suneel

    Suneel Guest

    hi everyone,
    I am working on a mdl application to dynamically pan the view.
    this shud trigger only when the cursor reaches the corners of the view.

    this app shud recenter the screen around the last point clicked by user.

    i have gone thru the earlier discussions and found out this code

    viewRange[0].z = viewRange[1].z = 0,

    mdlCnv_IPointToDPoint (&cursorPosition, &statedata.current.uors);

    viewRange[0].x = cursorPosition.x - 100*tcb->subpermast*tcb->uorpersub;
    viewRange[0].y = cursorPosition.y - 100*tcb->subpermast*tcb->uorpersub;
    viewRange[1].x = cursorPosition.x + 100*tcb->subpermast*tcb->uorpersub;
    viewRange[1].y = cursorPosition.y + 100*tcb->subpermast*tcb->uorpersub;

    mdlView_setArea (1, viewRange, NULL, 10.0, 1.0, NULL);
    mdlView_updateSingle (1);

    but when i run the command,
    screen runs away.
    also when i look the cursor position it seems to change too much
    from +ve to - ve values with the slightest change in the mouse position

    any help is appreciated..
    TIA

    Suneel.
     
    Suneel, Nov 10, 2004
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.