wordpress程序如何降低版本,seo公司软件,扬州网站建设myvodo,网站机房建设有助于问题
在计算三维点在图纸#xff08;DrawingDoc#xff09;中的位置时#xff0c;就是算不对#xff0c;明明就4、5行代码#xff0c;怎么看都是很“哇塞”的#xff0c;毫无问题的。
但结果就是不对。
那就调试一下吧#xff0c;调试后发现生成的矩阵很不对劲#…问题
在计算三维点在图纸DrawingDoc中的位置时就是算不对明明就4、5行代码怎么看都是很“哇塞”的毫无问题的。
但结果就是不对。
那就调试一下吧调试后发现生成的矩阵很不对劲是个单位矩阵很奇怪还什么都不提示
测试后发现 IMathUtility类中CreateTransform方法传入的数组必须长16。 // IMathUtility class.
// Creates a new math transform.
System.object CreateTransform( System.object ArrayDataIn
)// Transformation matrix data:
//
// | a b c . n |
// | d e f . o |
// | g h i . p |
// | j k l . m |
//
// The SOLIDWORKS transformation matrix is stored as a homogeneous matrix of 16 elements, ordered as shown. The first 9 elements (a to i) are elements of a 3x3 rotational sub-matrix, the next 3 elements (j, k, l) define a translation vector, and the next 1 element (m) is a scaling factor. The last 3 elements (n, o, p) are unused in this context.
//
// The 3x3 rotational sub-matrix represents 3 axis sets:
//
// row 1 for x-axis components of rotation
// row 2 for y-axis components of rotation
// row 3 for z-axis components of rotation IMathTransform
问4x4矩阵本来就是16个元素啊传长16数组不是很正常吗 答当然很正常但是在这里不太正常。
看看SolidWorks中矩阵的构成吧emmm就一个标准的矩阵。
再看看存储方式矩阵库一般都是列优先少部分是行优先。
这里就不同了它是0~8存xyz轴旋转9~11存平移12存缩放13~15是不使用的。
MathTransform 可以拿到存储数组通过属性ArrayData长16。
GetViewXFrom()方法返回的数组长13后三个未使用的不返回。然后我下意识就使用这个数组去创建矩阵。
可以传不报错结果不对是个单位矩阵。