简体   繁体   English

OpenGL ES中的纹理球体

[英]Textured sphere in OpenGL ES

I want to have a textured sphere in OpenGl ES. 我想在OpenGl ES中有一个纹理球体。 What is the best way to do this? 做这个的最好方式是什么? One option is to create it manually. 一种选择是手动创建它。 Another is to create it in eg Blender and load it - what file format should I use? 另一个是在例如Blender中创建并加载它 - 我应该使用哪种文件格式?

In blender, export the model as an obj file. 在blender中,将模型导出为obj文件。 Deselect the 90 degree rotation and select "triangulate". 取消选择90度旋转并选择“三角测量”。 If you are using lighting, enable the normals options. 如果您正在使用光照,请启用法线选项。

The next step is to convert the obj file to something easy to use. 下一步是将obj文件转换为易于使用的东西。 Use this tool: 使用此工具:

http://www.heikobehrens.net/2009/08/27/obj2opengl/ http://www.heikobehrens.net/2009/08/27/obj2opengl/

Now you have your vertices, normals and texture coordinates in arrays ready for you to render. 现在,您可以在阵列中使用顶点,法线和纹理坐标,以便渲染。

Good luck! 祝好运!

Edit: Android uses Java right? 编辑:Android使用Java吗? The tool exports to C header files but you should be able to easily convert it for java. 该工具导出到C头文件,但您应该能够轻松地将其转换为Java。

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

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