查看单个帖子
旧 2009-05-06, 06:49 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】ocs-wcs transformations

ocs->wcs transformations
ocs->wcs transformations
is there a class and method that performs ocs-to-wcs transformations (for points).
it seems somewhat laborious for everyone to have to write their own (arbitrary axis algorithm, etc.)
in general it seems the problem is:
given:
a normal vector (3d)
an ocs elevation
a point in ocs (3d)
calculate:
the wcs point (3d)
odgematrix3d seems like a logical place to look, but i can't see a way to specify the normal vector and ocs elevation....
thanks,
-allan
odgematrix3d has methods:
worldtoplane(normal) and planetoworld() returning transforms ocs<->wcs.
elevation can be taken into account for example in the following manner:
code:
odgevector3d normal;
odgepoint2d ocspoint;
odgepoint3d wcspoint;
odgematrix3d trans;
trans.settotranslation(odgevector3d(0., 0., elevation()));
trans.settoproduct(odgematrix3d:lanetoworld(normal), trans);
wcspoint.x = ocspoint.x;
wcspoint.y = ocspoint.y;
wcspoint.z = 0;
wcspoint.transformby(trans);
// or another variant
trans = odgematrix3d:lanetoworld(normal) ;
wcspoint.x = ocspoint.x;
wcspoint.y = ocspoint.y;
wcspoint.z = elevation;
wcspoint.transformby(trans);
sergey slezkin
thanks
thanks, sergey.
i will give it a try.
-allan
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)