User Frame/zh-hans

From SoftMC-Wiki
Jump to: navigation, search
语言: English  • 中文(简体)‎

用户坐标系

用户可以通过示教三点来添加自己的坐标系:A,B,C


Defining the frame

坐标系的原点在点A,点B和C有助于定义新坐标系的方向。

PROTO.PRO

必须在PROTO,PRO文件中定义新功能:

IMPORT_C RBT_TABLE(byval  as generic location, byval  as generic location, byval   as generic location,  as generic location ) as long

用法

调用:

-->?RBT_TABLE(A,B,C,D)

返回值

Anything except 0 is an error code.


例子

库定义:

IMPORT_C RBT_TABLE(byval  as generic location,byval  as generic location,byval   as generic location,  as generic location ) as long

public function Table(byval a as generic location,byval b as generic location,byval c  as generic location) as generic location
dim tmp as long
dim x as generic location
tmp = rbt_table(a,b,c,x)
if tmp then
  Print "Internal TABLE error",tmp
end if
Table = x
end function

用法

dim shared Xax as location of xyzypr = #{10,0,0,0,0,0}
dim shared Yax as location of xyzypr = #{0,10,0,0,0,0}
dim shared Zax as location of xyzypr = #{0,0,10,0,0,0}

dim shared Origin as location of xyzypr = #{10,20,30,0,0,0}

program

dim MyFrame as location of xyzypr
dim Res as generic location


MyFrame = Origin:#{0,0,0,45,45,45}
Print "MyFrame : ";Myframe
Res = Table(Origin,MyFrame:Xax,MyFrame:Yax)

Print "Res : ";res
  
end program 

Output:

MyFrame : #{10 , 20 , 30 , 45 , 45 , 45}
Res : #{10 , 20 , 30 , 45 , 45 , 45}

参考

源代码示例: File:FRAMES.ZIP

欧拉角变换 : Translating_Euler_Angles