几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】dolly and pan (http://www.dimcax.com/hust/showthread.php?t=15775)

yang686526 2009-05-04 08:02 PM

【转帖】dolly and pan
 
dolly and pan
dolly and pan
hi!
i抦 trying to pan using the dolly function, so fare no luck.
code:
void cdxfdocview::dolly(int x, int y)
{
odgevector3d vec( -x, -y , 0.0);
vec.transformby((pview->screenmatrix() * pview->projectionmatrix()).inverse());
pview->dolly(vec);
}i抳e used it for zooming in a window and for the plus- and minus- zoom as well, no problems. i would like to have a function one could feed with mouse coordinates on the fly, when moving the mouse around.
using above i get a slow, and very insensitive movement on the screen. the ratio between the drawing and the screen coords is also wrong. i get a unproportionally shorter movment (distance) for the drawing compaired to my mouse movement.
maybe someone can point me a more productive direction.
thanks in advance.


所有的时间均为北京时间。 现在的时间是 10:56 AM.