简体   繁体   English

更改3D对象上的纹理并导出2D图像

[英]Change texture on 3D object and export 2D image

I would like to generate 2D images of 3D books with custom covers on demand. 我想根据需要定制封面的3D图书的2D图像。

Ideally, I'd like to import a 3D model of a book (created by an artist), change the cover texture to the custom one, and export a bitmap image (jpeg, png, etc...). 理想情况下,我想导入一本书的3D模型(由艺术家创建),将封面纹理更改为自定义的,然后导出位图图像(jpeg,png等)。 I'm fairly ignorant about 3D graphics, so I'm not sure if that's possible or feasible, but it describes what I want to do. 我对3D图形一无所知,因此不知道这是否可行或可行,但它描述了我想做的事情。 Another method would be fine if it accomplishes something similar. 如果完成相似的操作,另一种方法会很好。 Like maybe I could start with a rendered 2D image and distort the custom cover somehow then put it in the right place over the original image? 也许我可以从渲染的2D图像开始,以某种方式扭曲自定义封面,然后将其放在原始图像的正确位置?

It would be best if I could do this using Python, but if that's not possible, I'm open to other solutions. 最好是可以使用Python进行此操作,但是如果无法做到这一点,则可以使用其他解决方案。

Any suggestions on how to accomplish this? 关于如何做到这一点的任何建议?

Sure it's possible. 当然可以。

Blender would probably be overkill, but you can script blender with python , so that's one solution. Blender可能会过大,但是您可以使用python编写Blender脚本 ,因此这是一种解决方案。

The latter solution is (I'm pretty sure) what most of those e-book cover generators do, which is why they always look a little off. 后一种解决方案是(我很确定)大多数这些电子书封面生成器的功能,这就是为什么它们总是看起来有点差的原因。

The PIL is an excellent tool for manipulating images and pixel data, so if you wanted to distort your own, that would be a great tool to look at, and if it goes too slow it's trivial to convert the image to a numpy array so you can get some speedup. PIL是用于处理图像和像素数据的出色工具,因此,如果您想使自己的图像失真,那将是一个很好的工具,并且如果它太慢的话,将图像转换为numpy数组很简单。可以加快速度。

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

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