Публичные API Изменения в Aspose.3D 2.1.0

Contents
[ ]

Содержание Резюме

Добавляет экспорт файлов Collada

Используя эту последнюю версию (2.1.0), разработчики могут экспортировать файлы Collada 3D. В предыдущей версии (2.0.0) мы уже добавили его функцию импорта, так как разработчики также могут конвертировать файл Collada в другие поддерживаемые форматы файлов 3D.

Добавляет параметры загрузки и сохранения для форматов файлов 3D

Мы добавили параметры загрузки и сохранения для каждого формата файла. Они взяты из исходных подклассов IOConfig.

Добавляет Aspose.ThreeD. Форматы. Класс ColladaSaveOptions

Он определяет настройки сохранения файла Collada 3D.

C#

 ColladaSaveOptions opts = new ColladaSaveOptions();

// generates indented XML document

opts.Indented = true;

// the style of node transformation

opts.TransformStyle = ColladaTransformStyle.Matrix;

// configure the look up paths to allow importer to find external dependencies.

opts.LookupPaths = new List<string>(new string[]{ @"c:\temp\" });

Добавляет Aspose.ThreeD. Форматы. Класс Discreet3DSLoadOptions

Он определяет настройки при загрузке незаметного файла 3DS.

C#

 Discreet3DSLoadOptions loadOpts = new Discreet3DSLoadOptions();

// sets weather to use the transformation defined in the first frame of animation track.

loadOpts.ApplyAnimationTransform = true;

// flip the coordinate system

loadOpts.FlipCoordinateSystem = true;

// prefer to use gamma-corrected color if a 3ds file provides both original color and gamma-corrected color.

loadOpts.GammaCorrectedColor = true;

// configure the look up paths to allow importer to find external dependencies.

loadOpts.LookupPaths = new List<string>(new string[]{ @"c:\temp\" });

Добавляет Aspose.ThreeD. Форматы. Класс Discreet3DSSaveOptions

Он определяет настройки сохранения незаметного файла 3DS.

C#

 // initialize an object

Discreet3DSSaveOptions saveOpts = new Discreet3DSSaveOptions();

// the start base for generating new name for duplicated names.

saveOpts.DuplicatedNameCounterBase = 2;

// the format of the duplicated counter.

saveOpts.DuplicatedNameCounterFormat = "NameFormat";

// the separator between object's name and the duplicated counter.

saveOpts.DuplicatedNameSeparator = "Separator";

// allows to export cameras

saveOpts.ExportCamera = true;

// allows to export light

saveOpts.ExportLight = true;

// flip the coordinate system

saveOpts.FlipCoordinateSystem = true;

// prefer to use gamma-corrected color if a 3ds file provides both original color and gamma-corrected color.

saveOpts.GammaCorrectedColor = true;

// use high-precise color which each color channel will use 32bit float.

saveOpts.HighPreciseColor = true;

// configure the look up paths to allow importer to find external dependencies.

saveOpts.LookupPaths = new List<string>(new string[]{ @"c:\temp\" });

// set the master scale

saveOpts.MasterScale = 1;

Добавляет Aspose.ThreeD.Formats. Класс FBXSaveOptions

Он определяет настройки сохранения файла FBX.

C#

 // initialize an object

FBXSaveOptions saveOpts = new FBXSaveOptions(FileFormat.FBX7500ASCII);

// generates the legacy material properties.

saveOpts.ExportLegacyMaterialProperties = true;

// fold repeated curve data using FBX's animation reference count

saveOpts.FoldRepeatedCurveData = true;

// always generates material mapping information for geometries if the attached node contains materials.

saveOpts.GenerateVertexElementMaterial = true;

// configure the look up paths to allow importer to find external dependencies.

saveOpts.LookupPaths = new List< string > (new string[]{ @"c:\temp\" });

// generates a video object for texture.

saveOpts.VideoForTexture = true;

Добавляет Aspose.ThreeD. Форматы. Класс ObjLoadOptions

Он определяет настройки при загрузке файла Obj.

C#

 // initialize an object

ObjLoadOptions loadObjOpts = new ObjLoadOptions();

// import materials from external material library file

loadObjOpts.EnableMaterials = true;

// flip the coordinate system.

loadObjOpts.FlipCoordinateSystem = true;

// configure the look up paths to allow importer to find external dependencies.

loadObjOpts.LookupPaths = new List<string>(new string[]{ @"c:\temp\" });

Добавляет Aspose.ThreeD. Форматы. Класс ObjSaveOptions

Он определяет настройки при сохранении файла Obj.

C#

 // initialize an object

ObjSaveOptions saveObjOpts = new ObjSaveOptions();

// import materials from external material library file

saveObjOpts.EnableMaterials = true;

// flip the coordinate system.

saveObjOpts.FlipCoordinateSystem = true;

// configure the look up paths to allow importer to find external dependencies.

saveObjOpts.LookupPaths = new List<string>(new string[]{ @"c:\temp\" });

// serialize W component in model's vertex position

saveObjOpts.SerializeW = true;

// generate comments for each section

saveObjOpts.Verbose = true;

Добавляет Aspose.ThreeD.Formats. Класс STLLoadOptions

Он определяет настройки при загрузке файла STL.

C#

 // initialize an object

STLLoadOptions loadSTLOpts = new STLLoadOptions();

// flip the coordinate system.

loadSTLOpts.FlipCoordinateSystem = true;

// configure the look up paths to allow importer to find external dependencies.

loadSTLOpts.LookupPaths = new List<string>(new string[]{ @"c:\temp\" });

Добавляет Aspose.ThreeD.Formats. Класс STLSaveOptions

Он определяет настройки сохранения файла STL.

C#

 // initialize an object

STLSaveOptions saveSTLOpts = new STLSaveOptions();

// flip the coordinate system.

saveSTLOpts.FlipCoordinateSystem = true;

// configure the look up paths to allow importer to find external dependencies.

saveSTLOpts.LookupPaths = new List<string>(new string[]{ @"c:\temp\" });

Добавляет Aspose.ThreeD. Форматы. Класс U3DLoadOptions

Он определяет настройки при загрузке файла U3D.

C#

 // initialize an object

U3DLoadOptions loadU3DOpts = new U3DLoadOptions();

// flip the coordinate system.

loadU3DOpts.FlipCoordinateSystem = true;

// configure the look up paths to allow importer to find external dependencies.

loadU3DOpts.LookupPaths = new List<string>(new string[]{ @"c:\temp\" });

Добавляет Aspose.ThreeD. Класс форматов. U3DSaveOptions

Он определяет настройки сохранения файла U3D.

C#

 // initialize an object

U3DSaveOptions saveU3DOptions = new U3DSaveOptions();

// export normal data.

saveU3DOptions.ExportNormals = true;

// export the texture coordinates.

saveU3DOptions.ExportTextureCoordinates = true;

// export the vertex diffuse color.

saveU3DOptions.ExportVertexDiffuse = true;

// export vertex specular color

saveU3DOptions.ExportVertexSpecular = true;

// flip the coordinate system.

saveU3DOptions.FlipCoordinateSystem = true;

// configure the look up paths to allow importer to find external dependencies.

saveU3DOptions.LookupPaths = new List<string>(new string[]{ @"c:\temp\" });

// compress the mesh data

saveU3DOptions.MeshCompression = true;

Добавляет методы к классу сцены Aspose.ThreeD.

Мы перегрузили методы Open и Save в классе Scene. Разработчики могут передавать потоковый объект или прямое имя файла для импорта/экспорта файла 3D, используя различные параметры загрузки/сохранения.

C#

 public void Open(System.IO.Stream stream, Aspose.ThreeD.Formats.LoadOptions options);

public void Open(string fileName, Aspose.ThreeD.Formats.LoadOptions options);

public void Save(System.IO.Stream stream, Aspose.ThreeD.Formats.SaveOptions options);

public void Save(string fileName, Aspose.ThreeD.Formats.SaveOptions options);

Удаление свойства FillDummyIndexArray из класса Aspose.ThreeD.Formats.FBXConfig

Это свойство не использовалось.

C#

 System.Nullable<Boolean> FillDummyIndexArray{ get;set;}

Обнаружить тип файла 3D

Метод Detect класса Aspose.ThreeD.FileFormat может распознавать тип любого поддерживаемого файла 3D.

C#

 FileFormat inputFormat = FileFormat.Detect(@"C:\ThreeD\test06\colors.fbx");

Console.WriteLine("File Format: " + inputFormat.ToString());

Добавляет методы обнаружения, CreateLoadOptions и CreateSaveOptions в класс Aspose.ThreeD.FileFormat

После распознавания типа файла 3D разработчики могут создавать объекты LoadOptions и SaveOptions для дальнейших задач манипуляции.

C#

 // allows to detect file format from file stream or filename

static Aspose.ThreeD.FileFormat Detect(System.IO.Stream stream, string fileName)

// allows to detect file format from filename

static Aspose.ThreeD.FileFormat Detect(string fileName)

// create default load options for this file format

Aspose.ThreeD.Formats.LoadOptions CreateLoadOptions()

// create default save options for this file format

Aspose.ThreeD.Formats.SaveOptions CreateSaveOptions()

Добавляет исключенное свойство к классам Aspose.ThreeD.Entity и Aspose.ThreeD.Node

Это позволяет удалить объект во время экспорта.

C#

 bool Excluded{ get;set;}

Добавлены Aspose.ThreeD. RenderState Class и Aspose.ThreeD.Render.BlendFactor/CompareFunction/CullFaceMode/FrontFace/PolygonMode/StencilAction/StencilState Enums

Состояния рендеринга предоставляют параметры для графического процессора для растеризации треугольников в пиксели.

Добавляет Shader API

API Shader определяют, как преобразовать треугольники из мирового пространства в экранное пространство и вычислить окончательный цвет пикселя на стороне GPU.

Добавляет абстрактный класс Aspose.ThreeD.Render.ShaderSource и подкласс Aspose.ThreeD.Render.GLSLSource

GLSLSource сообщает рендереру, что исходный код предназначен для языка затенения OpenGL, его можно скомпилировать в Aspose.ThreeD.Render.ShaderProgram.

Добавляет Aspose.ThreeD.Render. Класс исключения ShaderException

Исключения, связанные с Шейдером, в основном используются на этапе компиляции и связывания языка шейдеров.

Добавляет Aspose.ThreeD.Render.ShaderProgram Class

Это составленная программа шейдеров.

Добавить Aspose.ThreeD.Render.ShaderVariable Class

Он определяет переменные, используемые в шейдере.

Добавляет класс Enum Aspose.ThreeD.Render.VariableSemantic

Он используется для идентификации семантической переменной шейдера, рендерер Aspose.3D автоматически подготавливает значения переменной шейдера в зависимости от семантики.

Добавляет API буфера

Буферы предоставляют определение и данные треугольников.

Добавляет интерфейс Aspose.ThreeD.Render.IBuffer

Это базовый интерфейс для IIndexBuffer и IVertexBuffer.

Добавляет интерфейсы Aspose.ThreeD.Render.IIndexBuffer/IVertexBuffer

Они представляют аппаратные буферы для хранения индексов геометрии.

Добавляет Enum Aspose.ThreeD.Render.IndexDataType

Тип данных геометрических индексов.

Добавляет API-интерфейс Render

Добавляет интерфейс Aspose.ThreeD.Render.IRenderable

Объект, который поддерживает рендеринг, должен реализовать этот интерфейс.

Добавлен Enum Aspose.ThreeD.Render.DrawOperation

Примитивный тип рисовать.

Добавляет Enum Aspose.ThreeD.Render.RenderQueueGroupId

Aspose.3D API использует очередь рендеринга для управления рабочим процессом рендеринга, это используется для отправки операции рендеринга в указанную очередь рендеринга.

Добавляет Aspose.ThreeD.Render.RenderResource Class

Базовый класс для связывания модели Aspose.3D API с аппаратными ресурсами, он используется Aspose.3D внутри компании, но может раскрыть всю мощность рендеринга Aspose.3D.

Добавляет Aspose.ThreeD.Render.RenderableResource Class

Подкласс RenderResource, но сосредоточьтесь на рендеринге.

Добавляет Aspose.ThreeD.Entities.ManualEntity Class

Пользователь должен использовать этот класс для реализации своего собственного объекта, который поддерживает рендеринг, этот класс инкапсулирует детали операций рендеринга и управления ресурсами.

Добавляет несколько методов триангуляции в класс Aspose.ThreeD.Entities.PolygonModifier

Больше перегрузок, чтобы упростить использование оригинальной функции.

C#

 public static int[][]Triangulate(IList<[Aspose.ThreeD.Utilities.Vector4> controlPoints, IList<int[]> polygons);

public static int[][]Triangulate(IList<[Aspose.ThreeD.Utilities.Vector4> controlPoints, Int32[]polygon);

public static int[][]Triangulate(IList<Aspose.ThreeD.Utilities.Vector4> controlPoints);

Добавляет методы CreateVertexBuffer, CreateIndexBuffer, CreateTextureUnit, CreateRenderState и CreateShaderProgram в класс Aspose.ThreeD.Render.RenderFactory

C#

 public Aspose.ThreeD.Render.IVertexBuffer CreateVertexBuffer(Aspose.ThreeD.Utilities.VertexDeclaration declaration)

public Aspose.ThreeD.Render.IIndexBuffer CreateIndexBuffer()

public Aspose.ThreeD.Render.ITextureUnit CreateTextureUnit()

public Aspose.ThreeD.Render.RenderState CreateRenderState()

public Aspose.ThreeD.Render.ShaderProgram CreateShaderProgram(Aspose.ThreeD.Render.ShaderSource shaderSource, IList<Aspose.ThreeD.Utilities.VertexField> inputFields)

public Aspose.ThreeD.Render.ShaderProgram CreateShaderProgram(Aspose.ThreeD.Render.ShaderSource shaderSource, Aspose.ThreeD.Utilities.VertexDeclaration vertexDeclaration)

Добавляет методы BindRenderState, Drawindexed, Draw и SubmitRenderTask в класс Aspose.ThreeD. Renderer

C#

 public void BindRenderState(Aspose.ThreeD.Render.RenderState renderState)

public void DrawIndexed(Aspose.ThreeD.Render.DrawOperation drawOperation, Aspose.ThreeD.Render.IVertexBuffer vertexBuffer, Aspose.ThreeD.Render.IIndexBuffer indexBuffer, Int32 count)

public void Draw(Aspose.ThreeD.Render.DrawOperation drawOperation, Aspose.ThreeD.Render.IVertexBuffer vertexBuffer, Int32 first, Int32 count)

public void Draw(Aspose.ThreeD.Render.DrawOperation drawOperation, Aspose.ThreeD.Render.IVertexBuffer vertexBuffer)

public void DrawIndexed(Aspose.ThreeD.Render.DrawOperation drawOperation, Aspose.ThreeD.Render.IVertexBuffer vertexBuffer, Aspose.ThreeD.Render.IIndexBuffer indexBuffer)

public void SubmitRenderTask(Aspose.ThreeD.Render.RenderQueueGroupId groupId, Int32 priority, Aspose.ThreeD.Render.IRenderable renderableTask)

Добавляет свойства RenderStage и Shader в класс Aspose.ThreeD.Render.Renderer

C#

 public RenderStage RenderStage { get; }

public Aspose.ThreeD.Render.ShaderProgram Shader{ get;set;}