Files
konabot/konabot/docs/user/march.txt
bk_office 129870709b rad2deg
2026-04-27 21:56:05 +08:00

40 lines
1.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 指令介绍
简易 Raymarch 小玩具
用法march `<scene>`
march torus(1.0, 0.2).color(1.0, 0.2, 0.2) torus(1.0, 0.2).rot(90, 0, 0).color(0.2, 0.2, 1.0) camera(4.0).pos(4, 0, 0).lookat(0)
# 主要语法
`<scene>` ::= `<scene>` "." `<op>` |`<obj>`
`<obj>` ::= `<obj_ty>` | `<obj_ty>` "(" <args> ")"
`<op>` ::= `<op_ty>` | `<op_ty>` "(" `<args>` ")"
`<args>` ::= `<args>` "," `<arg>` | `<arg>`
其中 `obj_ty`、`op_ty` 分别为物体类型(如 `cube`、`sphere`、`torus` 等)与变换类型(如 `pos`、`rot`)。
# 支持的物体
目前支持的物体有(不包含 alias
`cube`:可选参数长宽高
`sphere`:可选参数半径
`torus`:可选参数半径与粗细
`cylinder`:可选参数半径与高度
`capsule`:可选参数高度与半径
特殊物体:
`mix`:混合两个物体
`bool`:两个物体相交
`minus`:两个物体相减
`camera`:相机,可选参数焦距
# 支持的变换
目前支持的变换有
`pos`:位移
`rot`:旋转(欧拉角 xyz
`color`:基础色
`lookat`:朝向
`rounded`:圆角
# 特殊说明
`<op_ty>` 不包含 scale。非正交的变换会破坏 SDF 的性质。