几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】how to create the transformation matrix implied by a given n (http://www.dimcax.com/hust/showthread.php?t=16639)

yang686526 2009-05-06 02:27 PM

【转帖】how to create the transformation matrix implied by a given n
 
how to create the transformation matrix implied by a given n
how to create the transformation matrix implied by a given normal
as title.
thank you very much.
odgematrix3d::worldtoplane
odgematrix3d::planetoworld
vladimir
thank you again!
but i just get the result.jpg.
attached images (21.7 kb, 13 views)
attached files (192.0 kb, 5 views)

algorithm
from the autodesk public "dxf reference":
arbitrary axis algorithm
let the given normal vector be called n.
let the world y axis be called wy, which is always (0,1,0).
let the world z axis be called wz, which is always (0,0,1).
here we are looking for the arbitrary x and y axes to go with the normal n.
they will be called ax and ay. n could also be called az (the arbitrary z axis)
as follows:
if (abs (nx) < 1/64) and (abs (ny) < 1/64) then
ax = wy x n (where 揦?is the cross-product operator).
otherwise,
ax = wz x n.
scale ax to unit length.
the method of getting the ay vector is as follows:
ay = n x ax. scale ay to unit length.
arbitrary


所有的时间均为北京时间。 现在的时间是 04:34 PM.