查看单个帖子
旧 2009-05-06, 03:18 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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:nlbuttonup 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:nlbuttonup(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
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)