Class GlobalTransform
パッケージ: @aspose/3d (v24.12.0)
GlobalTransform ノードのワールド空間変換の読み取り専用ビューを提供します。これは以下から取得されます node.globalTransform そして、ローカル Transform 行列をノードとすべての祖先に対して掛け合わせて計算されます。すべてのプロパティは読み取り専用です。ノードのワールド位置を変更するには、ローカル Transform ノードまたはその祖先のいずれかを変更する必要があります。.
export class GlobalTransformBoundingBoxExtent
FBX ファイルを読み込んだ後、ネストされたノードのワールド空間位置を取得します。.
import { Scene } from '@aspose/3d';
const scene = new Scene();
scene.open('character.fbx');
function printWorldPositions(node: any, depth: number = 0): void {
const gt = node.globalTransform;
const t = gt.translation;
console.log(`${' '.repeat(depth)}${node.name}: (${t.x.toFixed(3)}, ${t.y.toFixed(3)}, ${t.z.toFixed(3)})`);
for (const child of node.childNodes) {
printWorldPositions(child, depth + 1);
}
}
printWorldPositions(scene.rootNode);BoundingBoxExtent
すべてのプロパティは GlobalTransform 読み取り専用です。.
| BoundingBoxExtent | BoundingBoxExtent | BoundingBoxExtent |
|---|---|---|
translation | Vector3 | シーンルートの座標系におけるノードのワールド空間位置。. |
scale | Vector3 | ワールド空間スケール — ノードのローカルの積 scaling およびすべての祖先スケーリング。注: このプロパティは名前が scale (ではない scaling) をローカル空間から区別するために Transform.scaling. |
rotation | Quaternion | ワールド空間の向き(単位クォータニオン)として。. |
eulerAngles | Vector3 | ワールド空間の回転をラジアン単位のオイラー角で表現し、 rotation クォータニオン。. |
transformMatrix | Matrix4 | 完全なローカルからワールドへの 4×4 変換行列。. |
BoundingBoxExtent
GlobalTransformは読み取り時に計算されます。手動のリフレッシュ手順はなく、すべてのアクセスはnode.globalTransform新たに計算されたスナップショットを返します。.- BoundingBoxExtent
scaleプロパティはGlobalTransformがローカルに対応しますscalingプロパティがオンTransform.。名前の違いは意図的です::scale(単数形)はワールド空間から導出された値を示し、一方でscaling(名詞形)はローカルで設定可能なプロパティを示します。. - ジオメトリオフセット(
geometricTranslation,geometricScaling,geometricRotationオンTransform)はノード自身のジオメトリに適用されますが、子ノードには伝播しません;;GlobalTransformジオメトリオフセットは含まれません。.