← 返回函数库

t

Transformations Scope 已实现

CityEngine 官方语法

t(tx, ty, tz)

参数说明

参数类型默认值说明
tx, ty, tzfloat沿 scope X/Y/Z 轴的平移量。

描述

平移当前形状的 scope 原点。等价于 translate(tx, ty, tz)。平移操作不会改变几何体本身,只改变 scope 的位置。

t 是 translate 的缩写形式,功能完全相同。

官方示例

将 scope 向上移动 5 单位:

Mass --> t(0, 5, 0) Raised

实现说明

CGA.js 中的 t 实现基于 CityEngine 2025.1 官方文档。

🎨 3D 预览 — 平移

@StartRule\nLot --> primitiveCube(4, 4, 4)\n        t(2, 0, 0)\n        color(0.5, 0.5, 1)