如何生成纹理贴图图像? [英] How to generate texture mapping images?

查看:55
本文介绍了如何生成纹理贴图图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将图像放置/包装到3D对象中.为了使事情简单快速,我不想使用(学习)3D库,而是想使用映射图像.映射图像的使用方式如下:

I want to put/wrap images to 3D objects. To keep things simple and fast, instead of using(and learning) a 3D library I want to use mapping images. Mapping images are used in such a way:

因此,您将为每个对象生成一次映射图像,并对要包装的所有图像使用相同的映射.

So you generate the mapping images once for each object and use the same mapping for all images you want to wrap.

我的问题是,如何生成此类映射图像(基于3D模型)?由于我不了解该术语,因此我的搜索失败了.抱歉,如果我使用了错误的行话.

My question is how can I generate such mapping images (given the 3D model)? Since I don't know about the terminology my searches failed me. Sorry if I am using the wrong jargon.

下面您将看到工作流程的描述.

我具有对象和输入图像的3D模型,我想生成可用于生成纹理图像的映射图像.

Below you can see a description of the workflow.

I have the 3D model of the object and the input image, i want to generate mapping images that I can use to generate the textured image.

我什至不知道从哪里开始,任何指针都会受到赞赏.

I don't even know where to start, any pointers are appreciated.

更多信息

我的最初想法是使用外部程序以某种方式包装身份映射(请参见下文).我已经在Photoshop中生成了水平和垂直渐变图像,只是为了查看使用Photoshop生成的图像进行映射是否有效.结果看起来不太好.我不抱希望,但是值得一试.

My initial idea was to somehow wrap a identity mappings (see below) using an external program. I have generated horizontal and vertical gradient images in Photoshop just to see if mapping works using photoshop generated images. The result doesn't look good. I wasn't hopeful but it was worth a shot.

输入

映射(x和y),它们只是调整图像的大小,没有做任何花哨的事情.

mappings (x and y), they just resize the image, they don't do anything fancy.

结果

如您所见,有很多工件.我通过扭曲渐变生成的自定义映射图像看起来更糟.

result

as you can see there are lots of artifacts. Custom mapping images I have generated by warping the gradients even looks worse.

以下是有关映射的更多信息: http://www.imagemagick.org/Usage/mapping/#distortion_maps

Here is some more information on mappings: http://www.imagemagick.org/Usage/mapping/#distortion_maps

我正在使用OpenCV remap()函数进行映射.

I am using OpenCV remap() function for mapping.

推荐答案

要实现您要执行的操作,您需要将3D模型UV渲染为纹理.学习渲染3D比以这种方式做事要容易得多.尤其是因为您的方法存在很多弱点.难以照明,并且深度缓冲方面的问题会很多.

To achieve what you are trying to do, you need to render the 3D-models UV to a texture. It will be easier to learn to render 3D than to do things this way. Especially since there are a lot of weaknesses in your aproach. difficult to to lighting and problems til the depth-buffer will be abundant.

假设您只能从一个角度查看所有对象,则需要将每个对象渲染为3个纹理:

Assuming all your objects shul ever only be viewed from one angle, you need to render each of them to 3 textures:

紫外线贴图
法线贴图
深度图(用于校正深度缓冲区)

UV-map
Normal-map
Depth-map (to correct the depth-buffer)

您仍然必须进行着色才能将它们绘制为看起来像您的对象,而且我什至不知道如何进行深度缓冲操作,我只是知道可以做到.

You will still have to do shading in order to draw these to look like your object, and I don't even know how to do the depth-buffer-thing, I just know it can be done.

因此,为了避免学习3D,您将必须学习3D渲染的所有困难部分.似乎没有更简单的路线...

So in order to avoid learning 3D, your will have to learn all the difficult parts of 3D-rendering. Does not seem the easier route...

这篇关于如何生成纹理贴图图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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