Class GlobalTransform

Class GlobalTransform

パッケージ: @aspose/3d (v24.12.0)

GlobalTransform ノードのワールド空間変換の読み取り専用ビューを提供します。これは以下から取得されます node.globalTransform そして、ローカル Transform 行列をノードとすべての祖先に対して掛け合わせて計算されます。すべてのプロパティは読み取り専用です。ノードのワールド位置を変更するには、ローカル Transform ノードまたはその祖先のいずれかを変更する必要があります。.

export class GlobalTransform

BoundingBoxExtent

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 読み取り専用です。.

BoundingBoxExtentBoundingBoxExtentBoundingBoxExtent
translationVector3シーンルートの座標系におけるノードのワールド空間位置。.
scaleVector3ワールド空間スケール — ノードのローカルの積 scaling およびすべての祖先スケーリング。注: このプロパティは名前が scale (ではない scaling) をローカル空間から区別するために Transform.scaling.
rotationQuaternionワールド空間の向き(単位クォータニオン)として。.
eulerAnglesVector3ワールド空間の回転をラジアン単位のオイラー角で表現し、 rotation クォータニオン。.
transformMatrixMatrix4完全なローカルからワールドへの 4×4 変換行列。.

BoundingBoxExtent

  • GlobalTransform は読み取り時に計算されます。手動のリフレッシュ手順はなく、すべてのアクセスは node.globalTransform 新たに計算されたスナップショットを返します。.
  • BoundingBoxExtent scale プロパティは GlobalTransform がローカルに対応します scaling プロパティがオン Transform.。名前の違いは意図的です:: scale (単数形)はワールド空間から導出された値を示し、一方で scaling (名詞形)はローカルで設定可能なプロパティを示します。.
  • ジオメトリオフセット(geometricTranslation, geometricScaling, geometricRotation オン Transform)はノード自身のジオメトリに適用されますが、子ノードには伝播しません;; GlobalTransform ジオメトリオフセットは含まれません。.
 日本語