This commit is contained in:
bk_office
2026-04-27 21:56:05 +08:00
parent 8997c430c9
commit 129870709b
2 changed files with 4 additions and 1 deletions

View File

@ -1,7 +1,7 @@
# 指令介绍
简易 Raymarch 小玩具
用法march `<scene>`
march sphere(1).color(red) box(0.5, 2.0, 0.5).pos(0, 0, 0) cam(2.5).pos(-5).lookat(0)
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>`

View File

@ -39,6 +39,9 @@ class Transform:
return self
def rotate(self, x: float, y: float, z: float):
x = x / 180 * np.pi
y = y / 180 * np.pi
z = z / 180 * np.pi
cx, sx = np.cos(x), np.sin(x)
cy, sy = np.cos(y), np.sin(y)
cz, sz = np.cos(z), np.sin(z)