简体   繁体   English

iPhone OpenGl:导入3D模型

[英]iPhone OpenGl : importing 3D models

General openGl question here. 一般openGl问题在这里。 I guessing that to create 3D models to use with openGl-es I should use blender and save them as Obj. 我猜测要创建用于openGl-es的3D模型我应该使用blender并将它们保存为Obj。 Do I have to make a parser or does openGl ES support a certain format? 我是否必须制作解析器或openGl ES是否支持某种格式? what about animations? 动画怎么样?

Open Asset Import Library可以在iOS上使用,并根据3条款BSD许可证获得许可。

Using blender to save your models as obj files is a great way to go, imo. 使用blender将模型保存为obj文件是一个很好的方法,imo。 OpenGL doesn't, to my knowledge, have any pre-built functionality or preference for certain file formats. 据我所知,OpenGL没有任何预先构建的功能或对某些文件格式的偏好。 You'll likely have to make your own parser to load the vertex data or, if you'd prefer, you can use one of the many .obj loaders others have written and posted online. 您可能必须使用自己的解析器来加载顶点数据,或者,如果您愿意,可以使用其他人编写并在线发布的许多.obj加载器之一。 I would recommend writing your own loader, however. 不过,我建议你自己编写自己的装载机。 It's fun and you'll learn a lot. 这很有趣,你会学到很多东西。 Obj files are pretty easy, too. Obj文件也很简单。 This might be a good starting point, if you just want to adapt pre-written code. 如果您只是想调整预先编写的代码, 可能是一个很好的起点。

If you're still exploring 3D file formats though, I would recommend looking into Collada. 如果您仍在探索3D文件格式,我建议您查看Collada。 It's an XML format and supports textures, vert weights, and even animations. 它是一种XML格式,支持纹理,垂直权重甚至动画。 There's also a plug-in available for blender. 还有一个可用于搅拌机的插件 On the downside, it's a bit harder to find pre-made loaders out there and making your own takes a leap in difficulty from obj files. 不利的一面是,在那里找到预制的装载机并让自己从obj文件中获得难度的飞跃有点困难。 Sifting through Collada DOM should help get you well on your way, however, as it includes sample code for an OpenGL viewer and effects loader. 然而,筛选Collada DOM应该可以帮助您顺利完成,因为它包含OpenGL查看器和效果加载器的示例代码。 The Khronos faq might get you started if you have tons of questions about the format. 如果您对格式有很多疑问,Khronos常见问题解答可能会帮助您入门。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM