ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to implement AcGeMatrix3d::setToWorldToPlane(const AcGePlane& plane)

1 REPLY 1
Reply
Message 1 of 2
jzq740176597
707 Views, 1 Reply

How to implement AcGeMatrix3d::setToWorldToPlane(const AcGePlane& plane)

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);

planeInput 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!

1 REPLY 1
Message 2 of 2
Balaji_Ram
in reply to: jzq740176597

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 !!"));

 



Balaji
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost