几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】mouse pointer coordinates (http://www.dimcax.com/hust/showthread.php?t=17255)

yang686526 2009-05-06 06:05 PM

【转帖】mouse pointer coordinates
 
mouse pointer coordinates
mouse pointer coordinates
hi all,
i know this is a trivial question, but for me is a big problem... :-(
i want to insert a new entity into a dwg database.
the insert point must be specified by user when he clicks into the active view area.
after some searches into this forum, i'm using this piece of code:
odgematrix3d mattransform;
mattransform=getactiveview()->worldtodevicematrix();
mattransform.inverse();
odgepoint3d ptaux;
ptaux.x = devicept.x;
ptaux.y = devicept.y;
ptaux.z = 0.0;
ptaux.transformby(mattransform);
the problem is that ptaux has non realistic values (something like xxxe+20) and also mattransform seems to be not valid.
i do not have any perspective view...
is there any example showing how to obtain wcs coordinates from device coordinates ???
thank you very much for any suggestions...
carlo
see \examples\win\odamfcapp\editorobject.cpp, odexeditorobject::toeyetoworld
vladimir


所有的时间均为北京时间。 现在的时间是 04:11 PM.