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