İlk Aspose.3D uygulamanız

Uygulama nasıl oluşturulur

Aşağıdaki adımlar, uygulamayı Aspose kullanarak oluşturur. 3D API:

  1. Create an instance of the Scene class.
  2. 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.
  3. Yeni bir 3D dosyası oluşturun veya mevcut bir 3D dosyasını açın.
  4. Access the scene contents in the 3D file.
  5. 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.

// 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.

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