Put a Cinema 4D model and Texture into an iPhone App

谁说胖子不能爱 提交于 2019-12-04 10:51:40

问题


Im an iPhone developer and i'm trying to get a 3D model that I create in Cinema 4D into an app im making. I have actually found a way to get the model in (by exporting it as a .dae or obj and using a python script) which works really well however I can't get the textures to come with it. My script actually can only handle 1 texture as well.

Basically I need to ether create and export a UV map in c4d (but I have no idea how to do this) or I figure out a way to read multiple textures into my Open Gl - ES app with a script or PowerVR. (this is probably better)

Sorry for the noob questions but im very new at the 3D world.

Cheers


回答1:


I would recommend that you use Blender. Export your Cinema-4D model for Blender and use Blender to create UVMaps.

You need to make seams and unwrap the model. After that save a targa template for your texture, apply your texture on that targa. Save it as png or jpg. Apply that texture image to your model in Blender. Now you can export Wavefront OBJ file.

Use OpenGLOBJLoader class to render your model in iPhone. And one more thing: you should invert (subtract from 1) texture coordinates on y axis in order to get your texture rendered properly.

For example, if you have texture coordinates like this:

vt 0.800008 0.400000
vt 0.800008 0.150000
...

make sure that you have them inverted like this:

vt 0.800008 0.600000
vt 0.800008 0.850000
...



来源:https://stackoverflow.com/questions/5214904/put-a-cinema-4d-model-and-texture-into-an-iphone-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!