在三维空间中的图像的转动部分 [英] Rotating part of an image in 3D space

查看:200
本文介绍了在三维空间中的图像的转动部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是设置:这是一个电子商务的艺术网站,有些作品是油画转移。这幅画缠绕在侧面和顶部的画布和底部。我们拥有高清晰度的图像,整个绘画的,但我们希望显示的是图像的准三维重presentation,你可以在其中看到如何在画布周围画包的两侧。下面是我所谈论的是一个粗略的草图:

Here's the setup: This is for an ecommerce art site where some paintings are canvas transfers. The painting wraps around the sides and top and bottom of the canvas. We have high-res images of the entire painting, but what we want to display is a quasi-3D representation of the image in which you can see how the sides of the painting wrap around the canvas. Here's a rough sketch of what I'm talking about:

我的问题是,我怎么可以旋转在三维空间中的图像?我想我会采取,采取的办法是切断图像的顶部和侧面的一部分,而在3D旋转,然后再上施蒂希回顶部和侧面给它的三维外观。我该如何去这样做呢?它可以使用任何.NET技术(GDI +,WPF等)来完成。

My question is, how can I rotate an image in 3D space? The approach I think I'd like to take, is to cut off a portion of the top and side of the image, and rotate then in 3D and then stich it back on to the top and side to give it the 3D look. How do I go about about doing that? It can be done using any .Net technology (GDI+, WPF etc.).

推荐答案

在WPF中使用ViewPort3D类,你可以创建一个立方体是8x5x1单位。创建图像作为纹理,然后将纹理应用到使用纹理坐标的前面(8X5)和侧面(5×)和顶面和底面(8×1)。正面坐标应该是:(1/9,1/6),(8/9,1/6),(1/9,5/6)和(8/9,5/6)为正面,和从最近的边缘的那些坐标的两侧,如用于左侧:(0,1/6),(1/9,1/6),(0,5/6)和(1/9,5/6),用于左侧。

In WPF using the ViewPort3D class you can create a cuboid which is 8x5x1 units. Create the image as a texture and then apply the texture to the front face (8x5) and the side faces (5x1) and the top and bottom faces (8x1) using texture coordinates. The front face coordinates should be: (1/9, 1/6), (8/9, 1/6), (1/9, 5/6) and (8/9, 5/6) for the front face, and from the nearest edge to those coordinates for the sides, e.g. for the left side: (0, 1/6), (1/9, 1/6), (0, 5/6) and (1/9, 5/6) for the left side.

编辑: 如果你那么希望能够在3D画布模型进行旋转,你可以在这里照做: 我怎么做3D变换在WPF?

If you then want to be able to perform rotations on the 3D canvas model you can follow the advice here: How can I do 3D transformation in WPF?

这篇关于在三维空间中的图像的转动部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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