• Open Asset Import Library(assimp) vs2010编译


    Assimp(Open Asset Import Library)是一个开源的3D模型导入解析库,

    可以处理很多种3D文件格式:Collada, Blend, Obj, X, 3DS, LWO, MD5, MD2, MD3, MDL, MS3D等。

    现在最新的版本是assimp-3.0。

    下面是官方列出的一些特性:

    • Reads more than 30 3D file formats, including Collada, X, 3DS, Blend, Obj
    • Converts them to a hierarchical in-memory data structure
    • Provides 'post-processing steps' to improve the input data, i.e. generate normals and tangents or fix import issues.
    • Provides APIs for both C and C++
    • Imports skeleton animations and skinning weights
    • Supports complex multi-layer materials
    • Windows-based model viewer, the library itself is portable

    官方给出的预编译库是使用vs2008编译出来的,在vs2010中使用使用debug版本的库,有时会出现无法运行或运行出错等错误。解决的办法最好是在vs2010中重新编译一份库。仔细研究了下发现assimp是使用cmake管理工程的,只需要使用cmake生成vs2010工程,就可以使用vs2010编译出一份适用于vs2010的库了。具体步骤如下:

      

    1、安装boost

    assimp是依赖boost库的,如果没有boost库只能编译出一个功能受限的版本。

    boost官方链接:www.boost.org

    assimp没有用到boost需要编译的部分,所以boost只需要下载解压就可以了。

    2、assimp view依赖directx sdk

    如果需要编译assimp view,需要先安装directx sdk。

    微软的官方下载地址为:http://www.microsoft.com/en-us/download/details.aspx?id=6812

    点击exe文件进行安装,安装后,至少需要注销后,directx sdk的环境配置才会起作用。

    3、安装cmake

    cmake官方链接:www.cmake.org

    4、cmake创建assimp vs2010工程

    在assimp源码目录下,创建一个build文件夹,运行cmake

     选择assimp源码目录和编译二进制文件的目录,然后点Add Entry,添加BOOST_ROOT变量,type选STRING,value添加boost的目录。

    Open Asset Import Library vs2010编译 - lixiangtao2002 - lixiangtao2002的博客

     点击configure,选择vs2010编译器,配置没有错误后,然后点击generate生成vs2010工程。

    Open Asset Import Library vs2010编译 - lixiangtao2002 - lixiangtao2002的博客

       5、最后打开生成的vs2010工程,进行编译即可。

    Open Asset Import Library vs2010编译 - lixiangtao2002 - lixiangtao2002的博客

  • 相关阅读:
    轮廓 | outline (Basic User Interface)
    转换 | CSS Transitions (Animations & Transitions)
    越线 | line-break (Text)
    贴士和技巧 | CSS Animations: Tips (Animations & Transitions)
    负 | @counter-style.negative (Counter Styles)
    调整 | resize (Basic User Interface)
    再见乱码:5分钟读懂MySQL字符集设置
    git
    Python 内存&函数调用关系图
    Python 笔记
  • 原文地址:https://www.cnblogs.com/ttzm/p/5525616.html
Copyright © 2020-2023  润新知