将 Cinema 4D 模型和纹理放入 iPhone 应用程序 [英] Put a Cinema 4D model and Texture into an iPhone App

查看:24
本文介绍了将 Cinema 4D 模型和纹理放入 iPhone 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名 iPhone 开发人员,我正在尝试将我在 Cinema 4D 中创建的 3D 模型放入我正在制作的应用程序中.我实际上已经找到了一种方法来获取模型(通过将它导出为 .dae 或 obj 并使用 python 脚本),它非常有效,但是我无法获得纹理.我的脚本实际上也只能处理 1 个纹理.

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.

基本上我需要在 c4d 中创建和导出 UV 贴图(但我不知道如何执行此操作),或者我想出一种使用脚本或 PowerVR 将多个纹理读入我的 Open Gl - ES 应用程序的方法.(这可能更好)

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)

抱歉问了菜鸟问题,但我对 3D 世界很陌生.

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

干杯

推荐答案

我建议您使用 Blender.为 Blender 导出 Cinema-4D 模型并使用 Blender 创建 UVMap.

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

您需要制作接缝并打开模型.之后为您的纹理保存一个 targa 模板,将您的纹理应用于该 targa.将其另存为 png 或 jpg.将该纹理图像应用于 Blender 中的模型.现在您可以导出 Wavefront OBJ 文件.

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.

使用 OpenGLOBJLoader 类在 iPhone 中渲染您的模型.还有一件事:您应该反转(从 1 中减去)y 轴上的纹理坐标,以便正确渲染您的纹理.

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
...

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
...

vt 0.800008 0.600000
vt 0.800008 0.850000
...

这篇关于将 Cinema 4D 模型和纹理放入 iPhone 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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