Files
tools/接口/x平面镜像.ms
2025-07-31 16:05:55 +08:00

81 lines
1.2 KiB
Plaintext

/*
--//对齐旋转
a=$box003
b=$box002
*/
--//不建议使用这种写法
--a.rotation = b.rotation
--//建议使用这种写法
/*
a.rotation.x_rotation = b.rotation.x_rotation
a.rotation.y_rotation = b.rotation.y_rotation
a.rotation.z_rotation = b.rotation.z_rotation
*/
--//镜像旋转 --仅适用于本身对称物体
Fn XPosMirror yuanlai mubiao SY_index =
(
local OriginalEuler,TargetController,TargetEuler
OriginalEuler = yuanlai.Rotation.Controller.Value as EulerAngles
TargetEuler = Copy OriginalEuler
TargetController = mubiao.Rotation.Controller
case SY_index of
(
1:
(
TargetEuler.X *= -1
TargetEuler.Z *= -1
TargetEuler.Z += 180.0
)
2:
(
TargetEuler.X *= -1
TargetEuler.Z *= -1
)
3:
(
TargetEuler.X *= -1
TargetEuler.Z *= -1
TargetEuler.Z *= -1
TargetEuler.Y += 180.0
TargetEuler.Z += 180.0
)
default:
(
TargetEuler.X *= -1
TargetEuler.Z *= -1
TargetEuler.Z += 180.0
)
)
TargetController.Value = TargetEuler as quat
)
a=$
a.pivot
b=copy a
b.pos.x *= -1 ; XPosMirror a b 1
/*
a=b
b=copy a
b.pos.y *= -1 ; XPosMirror a b 2
a=b
b=copy a
b.pos.z *= -1 ; XPosMirror a b 3
*/