Scene — Aspose.3D FOSS for .NET

Example

Example Scene Aspose.3D のクラスは 3D コンテンツのルートコンテナとして機能し、トップレベルオブジェクトを管理し、シーン階層の親子関係管理を可能にします。ルートノードとサブシーンへのアクセスを提供し、3D シーンのロード、構築、保存のエントリーポイントを形成します。.

using Aspose.ThreeD;

// Create an empty scene
var scene = new Scene();

// Access the root node
Node root = scene.RootNode;

Example

Example Scene クラスは引数なしでインスタンス化でき、空のシーンを作成します。.

using Aspose.ThreeD;

// Empty scene
var scene = new Scene();

// Set name via property
scene.Name = "myScene";

// Access the root node
Node root = scene.RootNode;

Example

ExampleExampleExampleExample
RootNodeNode取得シーン階層のルートノード
AssetInfoAssetInfo取得/設定作者、作成日、単位などのアセットメタデータ
AnimationClipsList<AnimationClip>取得シーンで定義されたアニメーションクリップ
CurrentAnimationClipAnimationClip取得/設定現在アクティブなアニメーションクリップ
LibraryIList<A3DObject>取得シーンに添付されたユーザー定義メタデータオブジェクト
Namestring取得/設定シーンオブジェクトの名前
PropertiesPropertyCollection取得シーンに添付されたカスタムプロパティ

Example

Example戻り値の型Example
Open(string filePath)voidこのシーンにファイルを開きます。拡張子から形式を推測します
Open(string filePath, LoadOptions options)void形式固有のロードオプションでファイルを開きます
Open(Stream stream)voidストリームから自動検出で開きます
Open(Stream stream, LoadOptions options)voidストリームから形式固有のロードオプションで開きます
Open(Stream stream, string fileName)voidストリームから、ファイル名を使用して形式を検出しながら開きます
Save(string filePath)voidシーンをファイルに保存します;拡張子から形式を推測
Save(string filePath, FileFormat format)voidシーンを指定された形式で保存します FileFormat
Save(string filePath, SaveOptions options)void形式固有の保存オプションを使用して保存します
Save(Stream stream, SaveOptions options)void形式固有の保存オプションを使用してストリームに保存します
CreateAnimationClip(string name)AnimationClip新しい名前付きアニメーションクリップを作成します
GetAnimationClip(string name)AnimationClip名前で既存のアニメーションクリップを検索し、または null 見つからない場合
Clear()voidシーンのすべてのコンテンツをクリアします

Example

シーンを作成し、ボックスノードを追加して、GLB に保存する:

using Aspose.ThreeD;
using Aspose.ThreeD.Entities;
using Aspose.ThreeD.Formats;

// Create scene with a box primitive
var scene = new Scene();
var box = new Box(2, 2, 2);
var node = scene.RootNode.CreateChildNode("BoxNode", box);

// Save as GLB (format inferred from .glb extension)
scene.Save("box.glb");

参照

 日本語