Scene — Aspose.3D FOSS for .NET

Example

Example Scene class in 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
RootNodeNodeget씬 계층 구조의 루트 노드
AssetInfoAssetInfoget/set작성자, 생성 날짜 및 단위와 같은 에셋 메타데이터
AnimationClipsList<AnimationClip>get씬에 정의된 애니메이션 클립
CurrentAnimationClipAnimationClipget/set현재 활성화된 애니메이션 클립
LibraryIList<A3DObject>get씬에 첨부된 사용자 정의 메타데이터 객체
Namestringget/set씬 객체의 이름
PropertiesPropertyCollectionget씬에 첨부된 사용자 정의 속성

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");

참고

 한국어