3D mesh kodlaması Google Draco dosyasında
Contents
[
Hide
]
Aspose.3D for .NET API allows developers to import a 3D model, and then encode meshes in the Google Draco files. Developers can also specify the position, texture coordinates, color and normal bits as well as the compression level before encoding a mesh.
3D mesh alın ve Google Draco dosyasında kodlayın
DracoFormat
sınıfı tarafından maruz kalan Encode
yöntemi, Google Draco dosyasında bir 3d mesh kodlamak için kullanılabilir. Parametreler olarak Mesh
ve DracoSaveOptions
nesneleri alır. Draco kaydetme seçeneklerini kullanarak, geliştiriciler bir ağ kodlamadan önce konumu, doku koordinatlarını, rengini ve normal bitlerini ve sıkıştırma seviyesini de belirtebilirler.
Programming ample ample
This code example retrieves a Mesh
of Sphere
, and then encode in the Google Draco file after specifying a compression level.
This file contains hidden or 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
// For complete examples and data files, please go to https://github.com/aspose-3d/Aspose.3D-for-.NET | |
// Create a sphere | |
var sphere = new Sphere(); | |
// Encode the sphere to Google Draco raw data using optimal compression level. | |
var b = FileFormat.Draco.Encode(sphere.ToMesh(), | |
new DracoSaveOptions() { CompressionLevel = DracoCompressionLevel.Optimal }); | |
// Save the raw bytes to file | |
File.WriteAllBytes(RunExamples.GetOutputFilePath("SphereMeshtoDRC_Out.drc"), b); |