TA的每日心情![](source/plugin/dsu_paulsign/img/emot/kx.gif) | 开心 昨天 15:23 |
---|
签到天数: 69 天 [LV.6]常住居民II
管理员
- 积分
- 2704
|
AcGeMatrix3d::setToPlaneToWorld确定从平面到世界所需的转换。下面是一个示例代码段,它使用AcGeMatrix3d::alignCoordSys来确定相同的矩阵。我希望这有助于您理解AcGeMatrix3d::setToPlaneToWorld的功能。
AcGePlane testPlane = AcGePlane::kZXPlane;
// Plane Origin, X axis, Y axis and Z axis
AcGePoint3d fromOrigin;
AcGeVector3d fromXAxis;
AcGeVector3d fromYAxis;
testPlane.getCoordSystem(fromOrigin, fromXAxis, fromYAxis);
AcGeVector3d fromZAxis = testPlane.normal();
AcGeMatrix3d mat1 = AcGeMatrix3d::kIdentity;
mat1 = AcGeMatrix3d::alignCoordSys( fromOrigin,
fromXAxis,
fromYAxis,
fromZAxis,
AcGePoint3d::kOrigin,
AcGeVector3d::kXAxis,
AcGeVector3d::kYAxis,
AcGeVector3d::kZAxis
);
mat1 = mat1.inverse();
// Verify the matrix
AcGeMatrix3d mat2 = AcGeMatrix3d::kIdentity;
mat2 = AcGeMatrix3d::planeToWorld( testPlane );
if(mat1.isEqualTo(mat2))
acutPrintf(ACRX_T("Results are the same !!"));
else
acutPrintf(ACRX_T("Results differ !!")); |
|