如何将assimp导入我的Xcode项目? [英] How to import assimp to my my Xcode project?

查看:467
本文介绍了如何将assimp导入我的Xcode项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经下载了assimp源代码。如何将assimp导入Xcode项目-从ARToolkit官方网站下载的ARToolKit5?我正在尝试将外部模型-由blender,maya,3dmax制成-加载到该项目中。
(ps:我是Xcode的初学者,所以请详细解释。)
谢谢! :)

解决方案

我知道已经晚了,但它可能会使其他人受益。



步骤如下:


  1. 下载并提取源代码(对于3.3.1版)
    https://github.com/assimp/assimp/archive/v3。 3.1.zip


  2. 下载CMake Gui,选择源作为上面解压缩后的文件夹。在assimp文件夹中创建一个构建文件夹,并将其选择为构建目录。


  3. 选择配置并选择XCode。然后单击生成以在构建文件夹中生成构建文件。


  4. 在XCode的构建文件夹中打开Assimp.xcodeproj文件并对其进行构建。


  5. 现在您已经有了库并包含文件。库文件位于assimp(提取的文件)/ build / code / Debug中,include文件位于两个位置,一组位于assimp / include,另一组位于assimp / build / include。创建一个单独的文件夹库,并将其包含在所需的位置,然后将所有这些文件复制到您创建的相应文件夹中。


  6. 现在在XCode中打开项目。从左侧面板中选择您的项目,然后单击构建阶段,在链接二进制文件与库中单击+,然后单击添加其他,现在选择libassimp.4.0.1.dylib(选择最新版本)文件。 / p>


  7. 现在单击构建设置,在搜索路径中,将您创建的include文件夹添加到标题搜索路径,将库文件夹添加到库搜索路径。


如果正确执行了这些步骤,则可以在项目中使用这些语句

  #include< assimp / Importer.hpp> 
#include< assimp / scene.h>
#include< assimp / postprocess.h>


I have downloaded assimp source code. How to import assimp to Xcode project - ARToolKit5 downloaded from ARToolkit official website? I am trying to load external models - made by blender,maya,3dmax - to this project. (ps: I am a beginner of Xcode, so please explain it in detail. ) Thank you! :)

解决方案

I know it's late, but it might benefit someone else.

Here are the steps :

  1. Download and extract the source code from(for version 3.3.1) https://github.com/assimp/assimp/archive/v3.3.1.zip

  2. Download CMake Gui, and select source as the folder you got after extracting above. Create a build folder inside the assimp folder, and select it to be the build directory.

  3. Select Configure and select XCode. Then Click on generate to generate build files in the build folder.

  4. Open Assimp.xcodeproj file in build folder in XCode and build it.

  5. Now you have got the library and include files. The library files are located in assimp(which you extracted)/build/code/Debug, and the include files are at two locations, one set is at assimp/include and other at assimp/build/include. Make a separate folders library and include at your desired location and copy all these files in the corresponding folders you created.

  6. Now open your project in XCode. Select your project from the left panel, and click on Build phases, click on + inside 'Link Binary with libraries', and click on add other, now select the libassimp.4.0.1.dylib(select the latest version) file.

  7. Now click on Build settings, inside search paths, add your include folder(which you created) to the header search paths, and the library folder to library search paths.

If you followed the steps correctly, you could use these statements inside your project

#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>

这篇关于如何将assimp导入我的Xcode项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆