查看单个帖子
旧 2009-05-06, 02:27 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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:lanetoworld
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
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)