几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】how to transform window point to wcs poin (http://www.dimcax.com/hust/showthread.php?t=16782)

yang686526 2009-05-06 03:18 PM

【转帖】how to transform window point to wcs poin
 
how to transform window point to wcs point
how to transform window point to wcs point
hi,
i get a window (screen) point from a cview::onlbuttonup function (with 3d viewpoint ) and i need the 3d wcs point (or the 2d projection point) corresponding to the received screen point.
i try with
void cdwgview::onlbuttonup(uint nflags, cpoint point)
{
odgepoint3d wcspt((double) (point.x),(double) (point.y),0.0);
wcspt.transformby((pview->screenmatrix() * pview->projectionmatrix()).inverse());
wcspt.transformby(odabstractviewpeptr(pview)->eyetoworld(pview));
but it seems to be false
please help me
thanks
thanks,
laurent
the procedure you quoted works ok in our sample.
(the only addition - z coordinate is zeroed once more after tranforming from screen to eye plane. it rarely matters though)
vladimir
thanks for your answer, wladimir,
but the result point has unexplained values regarding to my dwg drawing...
so i probably forget something..
thanks,
laurent


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