İlk Aspose.3D uygulamanız
Contents
[
Hide
]
This tutorial explains how to create your first application using Aspose.3D’s simple API. This simple application creates a 3d file in a specified 3D scene.
Uygulama nasıl oluşturulur
Aşağıdaki adımlar, uygulamayı Aspose kullanarak oluşturur. 3D API:
- Create an instance of the Scene class.
- Eğer bir lisansınız varsa, o zaman Uygula. Değerlendirme sürümünü kullanıyorsanız, lisans ile ilgili kod satırlarını atlayın.
- Yeni bir 3D dosyası oluşturun veya mevcut bir 3D dosyasını açın.
- Access the scene contents in the 3D file.
- Değiştirilmiş 3D dosyasını oluşturun.
Yukarıdaki adımların uygulanması aşağıdaki örneklerde gösterilmiştir.
Yeni bir sahne belgesi nasıl oluşturulur
Aşağıdaki örnek, sıfırdan yeni bir 3D sahne dosyası oluşturur. İlk olarak, 3D sahne oluşturun ve ardından dosyayı FBX formatında kaydedin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The path to the documents directory. | |
String MyDir = RunExamples.getDataDir(); | |
MyDir = MyDir + "document.fbx"; | |
// Create an object of the Scene class | |
Scene scene = new Scene(); | |
// Save 3D scene document | |
scene.save(MyDir, FileFormat.FBX7500ASCII); |
Mevcut bir dosya nasıl açılır
The following example opens an existing 3D template file named “document.fbx” and then saves the 3D scene or document to a stream in various supported 3D formats.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The path to the documents directory. | |
String MyDir = RunExamples.getDataDir(); | |
// Load a 3D document into Aspose.3D | |
Scene scene = new Scene(); | |
// Open an existing 3D scene | |
scene.open(MyDir + "document.fbx"); | |
// Save Scene to a stream | |
try (MemoryStream dstStream = new MemoryStream()) { | |
scene.save(dstStream, FileFormat.FBX7500ASCII); | |
} | |
// Save Scene to a local path | |
scene.save(MyDir + "output_out.fbx", FileFormat.FBX7500ASCII); |