当前位置: 首页 > news >正文

秦皇岛网站优化自助建站教程

秦皇岛网站优化,自助建站教程,泰安新浪乐居房产网,南充网站建设114文章目录 1、简介2、下载编译3、代码测试3.1 C3.2 pyassimp#xff08;Python#xff09; 结语 1、简介 https://github.com/assimp/assimp Open Asset Import Library 是一个库#xff0c;用于将各种 3D 文件格式加载为共享的内存格式。它支持 40 多种用于导入的文件格式和… 文章目录 1、简介2、下载编译3、代码测试3.1 C3.2 pyassimpPython 结语 1、简介 https://github.com/assimp/assimp Open Asset Import Library 是一个库用于将各种 3D 文件格式加载为共享的内存格式。它支持 40 多种用于导入的文件格式和越来越多的用于导出的文件格式选择。 一个非常流行的模型导入库是Assimp它是Open Asset Import Library开放的资产导入库的缩写。Assimp能够导入很多种不同的模型文件格式并也能够导出部分的格式它会将所有的模型数据加载至Assimp的通用数据结构中。 当Assimp加载完模型之后我们就能够从Assimp的数据结构中提取我们所需的所有数据了。由于Assimp的数据结构保持不变不论导入的是什么种类的文件格式它都能够将我们从这些不同的文件格式中抽象出来用同一种方式访问我们需要的数据。 为 C 和 C 提供了 API。与其他语言C#、Java、Python、Delphi、D有各种绑定。Assimp 还可以在 Android 和 iOS 上运行。 此外Assimp 还具有各种网格后处理工具法线和切线空间生成、三角测量、顶点缓存局部优化、去除退化基元和重复顶点、按基元类型排序、合并冗余材料等等。 2、下载编译 https://github.com/assimp/assimp https://github.com/assimp/assimp/blob/master/Build.md https://assimp-docs.readthedocs.io/en/latest/about/quickstart.html#assimp-static-lib 下载代码 git clone https://github.com/assimp/assimp.git构建工程 cd assimp cmake CMakeLists.txt cmake --build .编译生成文件如下 3、代码测试 3.1 C 编译了assimp库文件之后再使用它自带的测试工程进行测试如下 比如SimpleOpenGL示例打开如下 编译运行如下 vs2017工程的参数设置的注意事项 项目配置 a. 项目属性 ---- C/C — 附加包含目录 — your_path\assimp-master\include b. 项目属性 ---- 链接器 — 常规 — 附加库目录 — your_path\lib c. 项目属性 ---- 链接器 — 输入 — 附加依赖项 — assimp-vc141-mtd.lib 这里使用一个更为简单的例子进行说明assimp开发流程如下 #include stdlib.h #include stdio.h#include assimp/postprocess.h // Post processing flags #include assimp/scene.h // Output data structure #include assimp/Importer.hpp // C importer interface #include iostream#pragma comment(lib, assimp-vc141-mtd.lib)void LoadFinish(const aiScene *scene) {std::cout LoadFinish ! NumVertices : (*(scene-mMeshes))-mNumVertices std::endl; }bool LoadModel(const std::string pFile) {// Create an instance of the Importer classAssimp::Importer importer;// And have it read the given file with some example postprocessing// Usually - if speed is not the most important aspect for you - youll// probably to request more postprocessing than we do in this example.const aiScene *scene importer.ReadFile(pFile,aiProcess_CalcTangentSpace |aiProcess_Triangulate |aiProcess_JoinIdenticalVertices |aiProcess_SortByPType);// If the import failed, report itif (!scene) {std::cout importer.GetErrorString() std::endl;return false;}// Now we can access the files contents.LoadFinish(scene);// Were done. Everything will be cleaned up by the importer destructorreturn true; }int main() {LoadModel(C:\\Users\\tomcat\\Desktop\\globe\\globe.obj);return 0; } 运行代码如下 3.2 pyassimpPython https://github.com/assimp/assimp/blob/master/port/PyAssimp/README.md 一个简单的 Python 包装器用于访问 Assimp用于访问库。 需要 Python 2.6。 PyAssimp 带有一个简单的 3D 查看器显示如何加载和显示 3D 使用基于着色器的 OpenGL 管道进行建模。 PyAssimp 需要一个 assimp 动态库在 windows、linux、macOS 上才能工作。 安装PyAssimp python setup.py install # or pip install pyassimp要加载一个名为 第一个网格的顶点 from pyassimp import load with load(hello.3ds) as scene:assert len(scene.meshes)mesh scene.meshes[0]assert len(mesh.vertices)print(mesh.vertices[0])运行发生错误提示assimp库文件不存在。 将上面编译生成的文件assimp-vc141-mt.dll放在下面文件夹里面。 再重新编译运行代码如下 另一个列出“顶级节点”的示例 from pyassimp import load with load(hello.3ds) as scene:for c in scene.rootnode.children:print(str(c))运行代码如下 结语 如果您觉得该方法或代码有一点点用处可以给作者点个赞或打赏杯咖啡╮(▽)╭ 如果您感觉方法或代码不咋地//(ㄒoㄒ)//就在评论处留言作者继续改进o_O??? 如果您需要相关功能的代码定制化开发可以留言私信作者(✿◡‿◡) 感谢各位大佬童鞋们的支持( ´ ▽´ ) ( ´ ▽´)っ
http://www.zqtcl.cn/news/451939/

相关文章:

  • 网站推广网络推广方wordpress汉语公益
  • 长沙做网站的公司有哪些宁波奉化建设局网站
  • 温岭专业自适应网站建设承德招聘信息网
  • 做公司网站的模板下载wordpress e
  • 网站建设基本知识wordpress 没有小工具
  • 北京完美建设有限公司网站酒店加盟
  • 山东网络推广网站德州市建设局质监站网站
  • api模式网站开发网站打开后显示建设中
  • 排名好的郑州网站建设免费营销培训
  • 美橙互联网站网站主要应用
  • 淘宝客网站做appuv推广平台
  • 网站公司可以做英文网吗图片加字制作免费
  • 海口个人建站模板精品课程云网站建设
  • 阿里网站空间莱芜新闻视频回放
  • 高清网站建设的好处wordpress 房产模板
  • 在建工程查询网站怎么自己开发网站
  • 旧电脑怎么做网站如何自己弄个免费网站
  • 聊城网站营销WordPress工作发布
  • 建造网站需要什么汽车网站建设
  • 网站建设app郑州发布评论
  • 福州网站制作建设网页设计图片是怎么显示的
  • 天津通用网站建设收费网站建设怎么在png上写文字
  • 浏阳做网站报价高校网站站群建设公司
  • 海口网站提升排名网站建设与管理考试题
  • 做网站的算什么行业ui视觉设计常用软件是什么
  • 成都网站建设公司哪家好西安搬家公司哪家便宜
  • 程序员自己做网站怎么能来钱上海猎头公司哪家好
  • 无忧网站建设哪家好手机网站php开发
  • 如何仿制一个网站wordpress+主题课堂
  • 公明做网站渭南网站开发