Files
tools/接口/旋转操作.ms
2025-07-31 16:05:55 +08:00

31 lines
1022 B
Plaintext

--//坐标解释
--//在表达式、操作或块表达式前面加上上下文前缀会导致在指定的坐标系中解释3D坐标操作
--//注:用法类似于animate on 仅影响块、后续表达式或下一行表达式
/*
in coordsys world --//使用世界坐标系
in coordsys local --//使用局部坐标系
in coordsys parent --//使用父级坐标系
in coordsys grid --//使用活动网格坐标系
in coordsys screen --//使用屏幕坐标系
in coordsys <node> --//使用节点对象坐标系
in coordsys <Matrix3> --//使用3D矩阵坐标系
*/
--//欧拉旋转
--a=$Box002
--rot=EulerAngles 0 10 0 --//定义一个特殊的欧拉对象rot
--rotate a rot --//将欧拉对象应用于对象a
--rotate a (EulerAngles 0 10 0) --//与上式等效
--rotate a 10 y_axis --//与上式等效
--//例如:
--in coordsys local selection.pos=random[-20,0,0][20,0,0] --//局部x轴随机位移-20到20的距离
--in coordsys local rotate selection (EulerAngles 0 10 0) --//局部坐标轴下绕y轴旋转10度
--in coordsys world rotate selection (EulerAngles 10 0 0) --//世界坐标轴下绕y轴旋转10度
--in coordsys world rotate selection 10 y_axis --//世界坐标轴下绕y轴旋转10度