Community
Hello, everyone!
I Have imp a Matrix3d of myself.The interface of it is very similar with AcGeMatrix3d,And I have imp a cmpare function to cmp them for testing the equality.
All other interface is done well. But I really don't know
setToWorldToPlane(const AcGePlane& plane);
plane | Input plane specifies a UCS whose origin is the origin of the plane, whose x-axis is the x-axis of the plane, etc. |
How To imp it?
Thanks!
Hi,
The AcGeMatrix3d::setToPlaneToWorld determines the transformation required from the plane to the world. Here is a sample code snippet that uses the AcGeMatrix3d::alignCoordSys to determine the same matrix. I hope this helps you understand what the AcGeMatrix3d::setToPlaneToWorld does.
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 !!"));