构建世界


预计完成时间:1 分钟

4.8   场景

scene 标签用于指定一个世界的场景属性。一个世界始终只能有一个 scene。请把下面的 scene 内容添加到 world 标签内部。

复制并粘贴

In [ ]:
<scene>
    <ambient>0.4 0.4 0.4 1</ambient>
    <background>0.7 0.7 0.7 1</background>
    <shadows>true</shadows>
</scene>

scene 还有很多可以通过文档设置的属性,但在本课程中,我们只使用 ambient、background 和 shadows 这几个标签。

  • <ambient> 标签用于设置环境光的颜色。
  • <background> 标签用于设置背景颜色。
  • <shadows> 标签用于开启或关闭阴影投射。