Public API Changes Aspose.3D 16.11.0

Contents Summary

Aspose.ThreeD.Node lass lass içinde dds dds ddddEntity ethethod

Bir düğüme bir varlık eklemek için shortcut kısayol yolu.

Ndd bir Node için bir Entity

 // initialize a Scene class object

Scene scene = new Scene();

// create a node

Node sphere = scene.RootNode.CreateChildNode("sphere");

// the old way to add an entity in a node

sphere.Entities.Add(new Sphere());

//the new way to add an entity in a node

sphere.AddEntity(new Sphere());

Import ve Export glTF Files

Developers son sürümü (16.11.0) veya daha yüksek şarkı söyleyen geliştiriciler glTF dosyalarını diğer desteklenen 3D dosyalarına aktarabilir ve aktarabilir.

Dds dds Aspose.ThreeD.Formats. Glass lass lass ooadlass ptions lass lass

We Gptions TFLptions oadptions ptions class ekledi. It glTF dosyalarını Aspose.3D API dosyasına aktarmaya yardımcı olur.

Lip lip V/T Texture ordinoordinate

 Scene scene = new Scene();

GLTFLoadOptions loadOpt = new GLTFLoadOptions();

//The default value is true, usually we don't need to change it.

//Aspose.3D will automatically flip the V/T texture coordinate during load and save.

//to make sure it's compatible with Aspose.3D

loadOpt.FlipTexCoordV = true;

scene.Open("Duck.gltf", loadOpt);

Dds dds Aspose.ThreeD.Formats. Glass lass aveavelass ptions lass lass

We, GLTaveaveaveaveptions class ekledi. It, glTF dosyasını kaydetme ayarlarını tanımlar.

EDDependenpendenside nside the ututput glTF File

 // the code example creates a glTF file that has a sphere, and embed all assets into the target file

// usually a glTF file comes with some dependencies, a bin file for model's vertex/indices, two .glsl files for vertex/fragment shaders

// use opt.EmbedAssets to tells the aspose.3D to export scene and embed the dependencies inside the target file.

Scene scene = new Scene();

scene.RootNode.CreateChildNode("sphere", new Sphere());

GLTFSaveOptions opt = new GLTFSaveOptions(FileContentType.ASCII);

opt.EmbedAssets = true;

scene.Save("d:\\test.gltf", opt);

Mse K___materials_common Mxtensions to Mefine the Materials

 // the code example creates a glTF file that has a sphere, and use KHR_materials_common extensions to define the materials

// thus no GLSL files are generated.

Scene scene = new Scene();

scene.RootNode.CreateChildNode("sphere", new Sphere());

GLTFSaveOptions opt = new GLTFSaveOptions(FileContentType.ASCII);

opt.UseCommonMaterials = true;

scene.Save("d:\\test.gltf", opt);

Bustomize Buffer ffer ile

 // the code example creates a glTF file that has a sphere, and the buffer file that defined the model to customize the filename

Scene scene = new Scene();

scene.RootNode.CreateChildNode("sphere", new Sphere());

GLTFSaveOptions opt = new GLTFSaveOptions(FileContentType.ASCII);

opt.BufferFile = "mybuf.bin";

scene.Save("d:\\test.gltf", opt);

Creates a Binary glTF File KHR_binary_glTF tension xtension kullanarak

 // the code example creates a binary glTF file using KHR_binary_glTF extension

Scene scene = new Scene();

// create a child node

scene.RootNode.CreateChildNode("sphere", new Sphere());

// save 3D file

scene.Save("d:\\test.glb", FileFormat.GLTF_Binary);

CSaving ptions ptions ile birlikte 07Extension kullanarak glTF File bir Binary reates

 // the code example creates a binary glTF file using KHR_binary_glTF extension but allow you to configure the save options

Scene scene = new Scene();

// create a child node

scene.RootNode.CreateChildNode("sphere", new Sphere());

// use saving options

GLTFSaveOptions opt = new GLTFSaveOptions(FileContentType.Binary);

opt.UseCommonMaterials = true;

// save 3D file

scene.Save("d:\\test.glb", opt);

Dds dds glTF Format try ntry Aspose.ThreeD.FileFormat lass lass

We, yükleme ve kaydetme amaçlı GLTF ve GLTF_Binary format girişlerini eklemiştir.

Dds dds Aspose.ThreeD. Filelass ormatlass ype lass lass bir Extension özelliği

Dosya biçiminin uzantısı adını almak için File. ormat. ype sınıfında bir Extension özelliği ekledik.

Real pendenpendeneal in the eal eal File System

Developers son sürümü (16.11.0) veya daha yüksek, geliştiriciler gerçek dosya sisteminde 3D sahne bağımlılıklarını kaydedebilir. Developers, yerel bir dizinin yolunu tanımlayabilir, MemoryFileSystem nesnesine kaydedebilir veya sadece bağımlılıkları atabilir. The Filestem ystem özelliği tüm kaydetme seçeneği sınıflarına eklenir.

Dds dds Aspose.ThreeD.Utilities. Dummyumilestem ystem lass lass

Erial iscard erial aving erial aterial Files

 // the code example uses the DummyFileSystem, so the material files are not created.

Scene scene = new Scene();

// create a child node

scene.RootNode.CreateChildNode("sphere", new Sphere()).Material = new PhongMaterial();

// set saving options

ObjSaveOptions opt = new ObjSaveOptions();

opt.FileSystem = new DummyFileSystem();

// save 3D scene

scene.Save("d:\\test.obj", opt);

Dds dds Aspose.ThreeD.Utilities. Locallass ilestem ystem lass lass

Local Directory içinde Dave pendenependencies

 // the code example uses the LocalFileSystem class to save dependencies to the local directory.

Scene scene = new Scene();

// create a child node

scene.RootNode.CreateChildNode("sphere", new Sphere()).Material = new PhongMaterial();

// set saving options

ObjSaveOptions opt = new ObjSaveOptions();

opt.FileSystem = new LocalFileSystem("E:\\");

// save 3D scene

scene.Save("d:\\test.obj", opt);

Dds dds Aspose.ThreeD. lities tilities.MemoryFileSystem lass lass

MemoryFileSystem MemoryFileSystem bject’de pendenave pendenependencies

 // the code example uses the MemoryFileSystem to intercepts the dependencies writing.

Scene scene = new Scene();

// create a child node

scene.RootNode.CreateChildNode("sphere", new Sphere()).Material = new PhongMaterial();

// set saving options

ObjSaveOptions opt = new ObjSaveOptions();

MemoryFileSystem mfs = new MemoryFileSystem();

opt.FileSystem = mfs;

// save 3D scene

scene.Save("d:\\test.obj", opt);

//get the test.mtl file content

byte[]mtl = mfs.GetFileContent("test.mtl");

File.WriteAllBytes("material.mtl", mtl);

Aspose.ThreeD.Formats. Ionononfig lass property içinde dds dds Filestem ystem özelliği

We, bağımlılıkları yazmak için Ifig fig onfig sınıfında bir File. ystem özelliği eklemiştir.

Dds dds a stem ilestem ystem özelliği

 Aspose.ThreeD.Utilities.FileSystem FileSystem{ get;set;}