Scene

Wyliczenia

Enumerations Scene klasa w Aspose.3D służy jako główny kontener dla treści 3D, zarządza obiektami najwyższego poziomu i umożliwia zarządzanie relacjami rodzic/dziecko w hierarchii sceny. Zapewnia dostęp do węzłów głównych i podscen, tworząc punkt wejścia do ładowania, konstruowania i zapisywania scen 3D.

import com.aspose.threed.Scene;

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

// Access the root node via getter method
Node root = scene.getRootNode();

Wyliczenia

Enumerations Scene klasa może być zainicjowana bez argumentów, aby utworzyć pustą scenę, lub z opcjonalnymi parametrami.

NameTypeAccessDescription
rootNodeNodeReadGets the root node.
assetInfoAssetInfoReadGets the asset info.
subScenesList<Scene>ReadGets the sub scenes.
libraryList<A3DObject>ReadGets the library.
animationClipsList<AnimationClip>ReadGets the animation clips.
currentAnimationClipAnimationClipReadGets the current animation clip.
posesCollection<Pose>ReadGets the poses.
VERSIONStringReadGets the version.
sceneSceneReadGets the scene.
nameStringReadGets the name.
propertiesPropertyCollectionReadGets the properties.
// Empty scene
Scene scene = new Scene();

// Scene with an initial entity
Scene scene = new Scene(new Mesh());

// Access the root node (getter method)
Node root = scene.getRootNode();

Metody klasy

SignatureDescription
Scene()Calls Scene on this Scene instance.
Scene(entity: Entity)Calls Scene(entity) on this Scene instance.
Scene(scene: Scene, name: String)Calls Scene(scene, name) on this Scene instance.
getRootNode() → NodeReturns the root node.
getAssetInfo() → AssetInfoReturns the asset info.
setAssetInfo(value: AssetInfo)Sets the asset info value.
getSubScenes() → List<Scene>Returns the sub scenes.
getLibrary() → List<A3DObject>Returns the library.
getAnimationClips() → List<AnimationClip>Returns the animation clips.
getCurrentAnimationClip() → AnimationClipReturns the current animation clip.
setCurrentAnimationClip(value: AnimationClip)Sets the current animation clip value.
getAnimationClip(name: String) → AnimationClipCalls getAnimationClip(name) on this Scene instance.
createAnimationClip(name: String) → AnimationClipCalls createAnimationClip(name) on this Scene instance.
getPoses() → Collection<Pose>Returns the poses.
clear()Calls clear on this Scene instance.
open(filePath: String)Calls open(filePath) on this Scene instance.
open(filePath: String, cancellationToken: Cancellation)Calls open(filePath, cancellationToken) on this Scene instance.
open(filePath: String, format: FileFormat)Calls open(filePath, format) on this Scene instance.
open(filePath: String, format: FileFormat, cancellationToken: Cancellation)Calls open(filePath, format, cancellationToken) on this Scene instance.
open(filePath: String, options: LoadOptions)Calls open(filePath, options) on this Scene instance.
open(filePath: String, options: LoadOptions, cancellationToken: Cancellation)Calls open(filePath, options, cancellationToken) on this Scene instance.
open(stream: InputStream)Calls open(stream) on this Scene instance.
open(stream: InputStream, cancellationToken: Cancellation)Calls open(stream, cancellationToken) on this Scene instance.
open(stream: InputStream, format: FileFormat)Calls open(stream, format) on this Scene instance.
open(stream: InputStream, format: FileFormat, cancellationToken: Cancellation)Calls open(stream, format, cancellationToken) on this Scene instance.
open(stream: InputStream, options: LoadOptions)Calls open(stream, options) on this Scene instance.
open(stream: InputStream, options: LoadOptions, cancellationToken: Cancellation)Calls open(stream, options, cancellationToken) on this Scene instance.
open(stream: Stream, format: FileFormat, options: LoadOptions)Calls open(stream, format, options) on this Scene instance.
open(stream: Stream, format: FileFormat, options: LoadOptions, cancellationToken: Cancellation)Calls open(stream, format, options, cancellationToken) on this Scene instance.
open(stream: Stream)Calls open(stream) on this Scene instance.
open(stream: Stream, cancellationToken: Cancellation)Calls open(stream, cancellationToken) on this Scene instance.
open(stream: Stream, format: FileFormat)Calls open(stream, format) on this Scene instance.
open(stream: Stream, format: FileFormat, cancellationToken: Cancellation)Calls open(stream, format, cancellationToken) on this Scene instance.
open(stream: Stream, options: LoadOptions)Calls open(stream, options) on this Scene instance.
open(stream: Stream, options: LoadOptions, cancellationToken: Cancellation)Calls open(stream, options, cancellationToken) on this Scene instance.
fromFile(filePath: String) → SceneCalls fromFile(filePath) on this Scene instance.
fromFile(filePath: String, cancellationToken: Cancellation) → SceneCalls fromFile(filePath, cancellationToken) on this Scene instance.
fromFile(filePath: String, format: FileFormat) → SceneCalls fromFile(filePath, format) on this Scene instance.
fromFile(filePath: String, format: FileFormat, cancellationToken: Cancellation) → SceneCalls fromFile(filePath, format, cancellationToken) on this Scene instance.
fromFile(filePath: String, options: LoadOptions) → SceneCalls fromFile(filePath, options) on this Scene instance.
fromFile(filePath: String, options: LoadOptions, cancellationToken: Cancellation) → SceneCalls fromFile(filePath, options, cancellationToken) on this Scene instance.
fromStream(stream: InputStream) → SceneCalls fromStream(stream) on this Scene instance.
fromStream(stream: InputStream, cancellationToken: Cancellation) → SceneCalls fromStream(stream, cancellationToken) on this Scene instance.
fromStream(stream: InputStream, format: FileFormat) → SceneCalls fromStream(stream, format) on this Scene instance.
fromStream(stream: InputStream, format: FileFormat, cancellationToken: Cancellation) → SceneCalls fromStream(stream, format, cancellationToken) on this Scene instance.
fromStream(stream: InputStream, options: LoadOptions) → SceneCalls fromStream(stream, options) on this Scene instance.
fromStream(stream: InputStream, options: LoadOptions, cancellationToken: Cancellation) → SceneCalls fromStream(stream, options, cancellationToken) on this Scene instance.
fromStream(stream: Stream) → SceneCalls fromStream(stream) on this Scene instance.
fromStream(stream: Stream, cancellationToken: Cancellation) → SceneCalls fromStream(stream, cancellationToken) on this Scene instance.
fromStream(stream: Stream, format: FileFormat) → SceneCalls fromStream(stream, format) on this Scene instance.
fromStream(stream: Stream, format: FileFormat, cancellationToken: Cancellation) → SceneCalls fromStream(stream, format, cancellationToken) on this Scene instance.
fromStream(stream: Stream, options: LoadOptions) → SceneCalls fromStream(stream, options) on this Scene instance.
fromStream(stream: Stream, options: LoadOptions, cancellationToken: Cancellation) → SceneCalls fromStream(stream, options, cancellationToken) on this Scene instance.
save(filePath: String)Calls save(filePath) on this Scene instance.
save(filePath: String, format: FileFormat)Calls save(filePath, format) on this Scene instance.
save(filePath: String, format: FileFormat, cancellationToken: Cancellation)Calls save(filePath, format, cancellationToken) on this Scene instance.
save(filePath: String, options: SaveOptions)Calls save(filePath, options) on this Scene instance.
save(filePath: String, options: SaveOptions, cancellationToken: Cancellation)Calls save(filePath, options, cancellationToken) on this Scene instance.
save(stream: OutputStream, format: FileFormat)Calls save(stream, format) on this Scene instance.
save(stream: OutputStream, format: FileFormat, cancellationToken: Cancellation)Calls save(stream, format, cancellationToken) on this Scene instance.
save(stream: OutputStream, options: SaveOptions)Calls save(stream, options) on this Scene instance.
save(stream: OutputStream, options: SaveOptions, cancellationToken: Cancellation)Calls save(stream, options, cancellationToken) on this Scene instance.
save(stream: OutputStream, format: FileFormat, options: SaveOptions)Calls save(stream, format, options) on this Scene instance.
save(stream: OutputStream, format: FileFormat, options: SaveOptions, cancellationToken: Cancellation)Calls save(stream, format, options, cancellationToken) on this Scene instance.
save(stream: Stream, format: FileFormat)Calls save(stream, format) on this Scene instance.
save(stream: Stream, format: FileFormat, cancellationToken: Cancellation)Calls save(stream, format, cancellationToken) on this Scene instance.
save(stream: Stream, options: SaveOptions)Calls save(stream, options) on this Scene instance.
save(stream: Stream, options: SaveOptions, cancellationToken: Cancellation)Calls save(stream, options, cancellationToken) on this Scene instance.
render(camera: Camera, fileName: String)Not implemented in the FOSS edition — throws at runtime. Calls render(camera, fileName) on this Scene instance.
render(camera: Camera, fileName: String, size: Vector2, format: String)Not implemented in the FOSS edition — throws at runtime. Calls render(camera, fileName, size, format) on this Scene instance.
render(camera: Camera, texture: TextureData)Not implemented in the FOSS edition — throws at runtime. Calls render(camera, texture) on this Scene instance.
SceneObject()Boolean operator allows you to apply Boolean operation on two IMeshConvertible instances.
getScene() → SceneConstructor of BooleanOperator.
A3DObject()Parameterized Cylinder. It can also be used to represent a cone when one of radiusTop/radiusBottom is zero.
getName() → StringThe segments of the curve.
setName(name: String)Constructs a CircleShape profile with specified radius.
getProperties() → PropertyCollectionInitializes a new instance of Cylinder class.
findProperty(name: String) → PropertyInitializes a new instance of the Bone class.
getProperty(name: String) → ObjectGets the transform matrix of the node in current pose.
setProperty(name: String, value: Object)Gets the width segments.
removeProperty(name: String) → booleanGets flip coordinate system of control points/normal during importing/exporting.
// Load from file (format detected from extension)
Scene scene = Scene.fromFile("model.obj");

// Load with options
ObjLoadOptions opts = new ObjLoadOptions();
Scene scene = Scene.fromFile("model.obj", opts);

Wyliczenia

Wszystkie właściwości są dostępne za pomocą metod getter/setter.

Wyliczenia

Wyliczenia

Utwórz scenę, dodaj węzeł siatki i zapisz do GLB:

import com.aspose.threed.Scene;
import com.aspose.threed.FileFormat;



// Create scene and mesh
Scene scene = new Scene();
Mesh mesh = new Mesh();
mesh.getControlPoints().add(new Vector4(0, 0, 0, 1));
mesh.getControlPoints().add(new Vector4(1, 0, 0, 1));
mesh.getControlPoints().add(new Vector4(0.5, 1, 0, 1));
mesh.createPolygon(0, 1, 2);

// Add node to root
Node node = scene.getRootNode().createChildNode("triangle", mesh);

// Save as GLB
GltfSaveOptions glbOpts = new GltfSaveOptions();
glbOpts.setContentType(FileContentType.BINARY);
scene.save("triangle.glb", glbOpts);

Zobacz także

 Polski