位置计算

向量A.subtract(向量B)

1 .返回新矢量3,即给定矢量与当前矢量3相减的结果
2 .let diff=current.subtract(startPointer)

向量A.subtractToRef(向量B,存的结果)

1 .从当前矢量3中减去给定矢量,并将结果存储在矢量“结果”中。

BABYLON.Matrix.Identity

1 .定义一个默认的矩阵变量
2 .

normalize()

1 .规范化当前向量3。请注意,这是一个就地操作

BABYLON.Axis.X

1 .获取坐标轴默认的x方向

BABYLON.Vector3.Zero()

1 .定义一个空的三维向量

BABYLON.Vector3.TransformNormalToRef

addInPlace

1 .将给定向量添加到当前向量3
2 .currentMesh.position.addInPlace(diff)

setAbsolutePosition

1 .从矢量3或阵列(3)设置网格在世界中的绝对位置。
2 .看起来这是把3D世界的东西显示成2DUI状
3 .const sphere1 = BABYLON.MeshBuilder.CreateSphere("sphere1", {diameter: 1, segments: 32}, scene);
sphere1.setAbsolutePosition(new BABYLON.Vector3(5, 2, 0))

你可能感兴趣的:(位置计算)