rad2deg
This commit is contained in:
@ -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>`
|
||||
|
||||
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user