Open Asset Import Library(assimp) vs2010编译

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

能够处理不少种3D文件格式:Collada, Blend, Obj, X, 3DS, LWO, MD5, MD2, MD3, MDL, MS3D等。post

如今最新的版本是assimp-3.0。ui

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

  • 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的库了。具体步骤以下:orm

  

一、安装boostci

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

boost官方连接:www.boost.organimation

assimp没有用到boost须要编译的部分,因此boost只须要下载解压就能够了。编译器

 

二、assimp view依赖directx sdk源码

若是须要编译assimp view,须要先安装directx sdk。

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

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

 

三、安装cmake

cmake官方连接:www.cmake.org

 

四、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的博客

 

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

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

相关文章
相关标签/搜索