浏览我们的产品

Aspose.3D for .NET 23.4 发布说明

改进和变更

KeySummaryCategory
THREEDNET-1359导出到 OBJ - 图像/纹理文件未复制到 OBJ 目录Task
THREEDNET-1361解除对 System.Drawing 的依赖Task
THREEDNET-1360允许在 OBJ 导出器中导出 PBR 材料定义和法线贴图Improvement
THREEDNET-1357加载 obj 文件时缺少材质和纹理Bug fixing
THREEDNET-1358导入 obj 文件时,ControlPoints 遇到错误读取数据并将其读取为法向量数据Bug fixing

API 变更

自 23.4 起,不再需要 System.Drawing,用于 System.Drawing 的类型现已替换为提供类似功能的现有类型:

Old TypeNew TypeDescription
System.Drawing.Imaging.ImageFormatSystem.String使用图像文件扩展名来表示图像格式,支持的图像格式基于纹理编解码器。
System.Drawing.SizeAspose.ThreeD.Utilities.Vector2
System.Drawing.PointAspose.ThreeD.Utilities.Vector2
System.Drawing.ColorAspose.ThreeD.Utilities.Vector3
System.Drawing.RectangleAspose.ThreeD.Utilities.Rect
System.Drawing.BitmapAspose.ThreeD.Render.TextureData

添加到类 Aspose.ThreeD.Formats.SaveOptions 的成员:

    /// <summary>
    /// 尝试将场景中使用的纹理复制到输出目录。 
    /// </summary>
    bool ExportTextures{ get;set;}

示例代码

将场景导出到 obj 文件并导出纹理文件:

移除类 Aspose.ThreeD.Shading.RenderingAPI

移除类 Aspose.ThreeD.Shading.ShadingLanguage

这些类已过时数月,并已按计划移除。

添加类 Aspose.ThreeD.Render.ITextureCodec

添加类 Aspose.ThreeD.Render.ITextureDecoder

添加类 Aspose.ThreeD.Render.ITextureEncoder

添加类 Aspose.ThreeD.Render.TextureCodec

在 Aspose.3D 23.4 中,我们移除了对 System.Drawing 的依赖,纹理解码将在外部编解码器中完成,我们提供 示例代码 来集成 Aspose.3D 与外部图像编码器/解码器,在大多数情况下不需要纹理编解码器。

添加类 Aspose.ThreeD.Render.PixelMapMode

添加类 Aspose.ThreeD.Render.PixelMapping

添加到类 Aspose.ThreeD.Render.TextureData 的成员:

        /// <summary>
        /// 将所有像素映射为读/写
        /// </summary>
        /// <param name="mapMode">映射模式</param>
        /// <returns>返回一个映射对象,当不再需要时应将其释放。</returns>
        public Aspose.ThreeD.Render.PixelMapping MapPixels(Aspose.ThreeD.Render.PixelMapMode mapMode)

        /// <summary>
        /// 以给定的像素格式将所有像素映射为读/写
        /// </summary>
        /// <param name="mapMode">映射模式</param>
        /// <param name="format">像素格式</param>
        /// <returns>返回一个映射对象,当不再需要时应将其释放。</returns>
        public Aspose.ThreeD.Render.PixelMapping MapPixels(Aspose.ThreeD.Render.PixelMapMode mapMode, Aspose.ThreeD.Render.PixelFormat format)

        /// <summary>
        /// 以给定的像素格式将由矩形寻址的像素映射为读取/写入
        /// </summary>
        /// <param name="rect">要访问的像素区域</param>
        /// <param name="mapMode">映射模式</param>
        /// <param name="format">像素格式</param>
        /// <returns>返回一个映射对象,当不再需要时应将其释放。</returns>
        /// <exception cref="NotSupportedException"></exception>
        public Aspose.ThreeD.Render.PixelMapping MapPixels(Aspose.ThreeD.Utilities.Rect rect, Aspose.ThreeD.Render.PixelMapMode mapMode, Aspose.ThreeD.Render.PixelFormat format)

示例代码

用于读取或写入的 TextureData 中的像素映射,外部纹理编解码器可以使用这些进行图像编码或解码。

这是 System.Drawing.Bitmap 像素操作的替代方案。

添加到类 Aspose.ThreeD.Render.TextureData 的成员:

        /// <summary>
        /// 将像素布局转换为新的像素格式。
        /// </summary>
        /// <param name="pixelFormat">目标像素格式</param>
        /// <exception cref="NotSupportedException">如果源或目标像素格式不受支持</exception>
        public void TransformPixelFormat(Aspose.ThreeD.Render.PixelFormat pixelFormat)

示例代码

将 TextureData 中的内部像素格式转换为指定的格式:

从类 Aspose.ThreeD.Render.TextureData 移除成员:

        public static Aspose.ThreeD.Render.TextureData FromBitmap(System.Drawing.Bitmap bitmap)
        public System.Drawing.Bitmap ToBitmap()

当不再在 Aspose.ThreeD 中使用 System.Drawing.Bitmap 时,这些方法不再需要。


 
 简体中文