Scene

Example

Example Scene klasse in Aspose.3D dient als de hoofdcontainer voor 3D-inhoud, beheert objecten op het hoogste niveau en maakt beheer van ouder/kind‑relaties voor de scenahiërarchie mogelijk. Het biedt toegang tot rootnodes en sub‑scènes, en vormt het toegangspunt voor het laden, construeren en opslaan van 3D‑scènes.

using Aspose.ThreeD;

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

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

Example

Example Scene klasse kan worden geïnstantieerd zonder argumenten om een lege scène te maken.

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

NameTypeAccessDescription
SubScenesIList<Scene>ReadGets the sub scenes.
LibraryIList<A3DObject>ReadGets the library.
AnimationClipsIList<AnimationClip>ReadGets the animation clips.
CurrentAnimationClipAnimationClip?Read/WriteGets or sets the current animation clip.
AssetInfoAssetInfo?Read/WriteGets or sets the asset info.
PosesICollection<Pose>ReadGets the poses.
RootNodeNodeReadGets the root node.
SceneSceneReadGets the scene.
NamestringRead/WriteGets or sets the name.
PropertiesPropertyCollectionReadGets the properties.

Example

SignatureDescription
Scene()
Scene(entity: Entity)
Scene(parentScene: Scene, name: string)
GetAnimationClip(name: string)Gets a named AnimationClip
Clear()Clears the scene content and restores the default settings.
CreateAnimationClip(name: string)A shorthand function to create and register the The first AnimationClip will be assigned to the
Open(stream: Stream, format: FileFormat, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
Open(stream: Stream, options: LoadOptions, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
Open(stream: Stream)Opens the scene from given stream using specified file format.
Open(stream: Stream, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
Open(stream: Stream, fileName: string)Opens the scene from given stream using specified file format.
Open(stream: Stream, fileName: string, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
Open(stream: Stream, options: LoadOptions)Opens the scene from given stream using specified file format.
Open(fileName: string, format: FileFormat, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
Open(fileName: string, options: LoadOptions)Opens the scene from given stream using specified file format.
Open(fileName: string, options: LoadOptions, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
Open(fileName: string)Opens the scene from given stream using specified file format.
Open(fileName: string, format: FileFormat)Opens the scene from given stream using specified file format.
Open(fileName: string, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
FromStream(stream: Stream, format: FileFormat, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
FromStream(stream: Stream, options: LoadOptions, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
FromStream(stream: Stream, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
FromFile(fileName: string, format: FileFormat, cancellationToken: CancellationToken)Opens the scene from given path using specified file format.
FromFile(fileName: string, options: LoadOptions, cancellationToken: CancellationToken)Opens the scene from given path using specified file format.
FromFile(fileName: string)Opens the scene from given path using specified file format.
FromFile(fileName: string, cancellationToken: CancellationToken)Opens the scene from given path using specified file format.
Save(stream: Stream, format: FileFormat)Saves the scene to stream using specified file format.
Save(stream: Stream, format: FileFormat, cancellationToken: CancellationToken)Saves the scene to stream using specified file format.
Save(stream: Stream, options: SaveOptions)Saves the scene to stream using specified file format.
Save(stream: Stream, options: SaveOptions, cancellationToken: CancellationToken)Saves the scene to stream using specified file format.
Save(fileName: string, format: FileFormat, cancellationToken: CancellationToken)Saves the scene to stream using specified file format.
Save(fileName: string)Saves the scene to stream using specified file format.
Save(fileName: string, format: FileFormat)Saves the scene to stream using specified file format.
Save(fileName: string, options: SaveOptions)Saves the scene to stream using specified file format.
Save(fileName: string, options: SaveOptions, cancellationToken: CancellationToken)Saves the scene to stream using specified file format.
Render(camera: Entities.Camera, fileName: string)Not implemented in the FOSS edition — throws at runtime. Render the scene into external file from given camera’s perspective. The default output size is 1024x768 and output format is png
Render(camera: Entities.Camera, fileName: string, size: Vector2, format: string)Not implemented in the FOSS edition — throws at runtime. Render the scene into external file from given camera’s perspective. The default output size is 1024x768 and output format is png
Render(camera: Entities.Camera, fileName: string, size: Vector2, format: string, options: ImageRenderOptions)Not implemented in the FOSS edition — throws at runtime. Render the scene into external file from given camera’s perspective. The default output size is 1024x768 and output format is png
Render(camera: Entities.Camera, bitmap: object)Not implemented in the FOSS edition — throws at runtime. \u003C/summary>
Render(camera: Entities.Camera, bitmap: object, options: ImageRenderOptions)Not implemented in the FOSS edition — throws at runtime. \u003C/summary>
SceneObject(name: string)
A3DObject()
RemoveProperty(property: Property)Removes a dynamic property.
GetProperty(property: string)Get the value of specified property
SetProperty(property: string, value: object?)Sets the value of specified property
FindProperty(propertyName: string)Finds the property. It can be a dynamic property (Created by CreateDynamicProperty/SetProperty) or native property(Identified by its name)

Example

Maak een scène, voeg een box node toe en sla op als 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");

Zie ook

 Nederlands