Create and Read an Existing 3D Scene
Contents
[
Hide
]
Create an Empty 3D Scene and Save in Supported 3D File Formats
Aspose.3D API supports creating the new 3D scenes from the scratch and then save in any supported file format. Developers can also load an existing 3D Scene for the modification, addition or processing purposes.
Creating a 3D Scene Document
Please follow these steps to create a 3D Scene document using the Aspose.3D APIs:
- Create an instance of the
Sceneclass that represents a 3D scene document. - Generate a 3D Scene document by calling the
Savemethod of the Scene class object.
Creating a 3D Scene Document: Programming Samples
import aspose.threed as a3d
# For complete examples and data files, please go to https://github.com/aspose-3d/Aspose.3D-for-.NET
# The path to the documents directory.
# Create an object of the Scene class
scene = a3d.Scene()
# Save 3D scene document
scene.Save("document.fbx", a3d.FileFormat.FBX7500ASCII)Reading a 3D Scene
Using Aspose.3D API, developers can load all the supported 3D documents. The available constructors of the Scene class allow to do so and they accept a valid file path string. The supported readable file formats are as follows:
- FBX 7.7 (ASCII, Binary)
- FBX 7.6 (ASCII, Binary)
- FBX 7.5 (ASCII, Binary)
- FBX 7.4 (ASCII, Binary)
- FBX 7.3 (ASCII, Binary)
- FBX 7.2 (ASCII, Binary)
- STL (ASCII, Binary)
- WavefrontOBJ
- Discreet3DS
- Universal3D
- Collada
- glTF
- DXF
- PLY (ASCII, Binary)
- X (ASCII, Binary)
- XYZ
- Draco
- 3MF
- RVM (Text, Binary)
- ASE
- USDZ
- USD
Constructors of the Scene class detect 3D document format internally.
Reading a 3D Scene: Programming Samples
import aspose.threed as a3d
# For complete examples and data files, please go to https://github.com/aspose-3d/Aspose.3D-for-.NET
# The path to the documents directory.
# Initialize a Scene class object
scene = Scene()
# Load an existing 3D document
scene.open("document.fbx")