物体变换与地形生成技术详解
1. 物体变换基础
在物体操作中,变换是一个重要工具,它能对物体进行定位、定向、变形等操作。常见的变换类型有平移、旋转和缩放。为了处理物体的变换,我们创建了一个名为 Transformation 的类,该类存储物体的平移、旋转和缩放信息,并创建一个矩阵来保存这些变换的组合。以下是 Transformation 类的代码:
// Translate
Vector3 translate;
// Rotate around the (X, Y, Z) world axes
Vector3 rotate;
// Scale the X, Y, Z axes
Vector3 scale;
bool needUpdate;
// Store the combination of the transformations
Matrix matrix;
public Vector3 Translate
{
get { return translate; }
set { translate = value; needUpdate = true; }
}
public Vector3 Rotate
{
get { return rotate; }
set { rotate = value; needUpdate = true; }
}
public Vector3 Scale
{
get { return scale; }
set { scale = value; needUpdate = true; }
}
public M
超级会员免费看
订阅专栏 解锁全文
1971

被折叠的 条评论
为什么被折叠?



