如何镜像半个3D网格物体?

时间:2021-05-27 04:51:51

Let assume that we have a half 3D mesh object and want to mirror it, in C# 2008 Express. That is, we want to have its simetrical part according to the center line of the object.

假设我们有一个半3D网格对象,并希望在C#2008 Express中镜像它。也就是说,我们希望根据对象的中心线来设置其simetrical部分。

Could you help me to do that.

你能帮帮我吗?

Thanks in advance.

提前致谢。

2 个解决方案

#1


You can try scaling it negatively in one axis, that should essentially flip it.

您可以尝试在一个轴上对其进行负向缩放,这应该基本上将其翻转。

So if its scale is (1, 1, 1), change it to (-1, 1, 1).

因此,如果其比例为(1,1,1),则将其更改为(-1,1,1)。

#2


hmmmm... here is the algorithm I would use:

嗯......这是我会用的算法:

  1. Find the point on the mesh that you would want to reflect about. Call it p0.
  2. 在网格上找到您想要反映的点。称之为p0。

  3. Translate the object so that p0 lies on the origin (0,0,0).
  4. 翻译对象,使p0位于原点(0,0,0)。

  5. Now rotate the object 180 degrees about the origin along your desired plane of rotation.
  6. 现在沿着所需的旋转平面将对象绕原点旋转180度。

  7. Translate back to p0.
  8. 转回p0。

This should give you a reflection of the object about the line you wish to rotate around.

这应该可以反映出您想要旋转的线的对象。

#1


You can try scaling it negatively in one axis, that should essentially flip it.

您可以尝试在一个轴上对其进行负向缩放,这应该基本上将其翻转。

So if its scale is (1, 1, 1), change it to (-1, 1, 1).

因此,如果其比例为(1,1,1),则将其更改为(-1,1,1)。

#2


hmmmm... here is the algorithm I would use:

嗯......这是我会用的算法:

  1. Find the point on the mesh that you would want to reflect about. Call it p0.
  2. 在网格上找到您想要反映的点。称之为p0。

  3. Translate the object so that p0 lies on the origin (0,0,0).
  4. 翻译对象,使p0位于原点(0,0,0)。

  5. Now rotate the object 180 degrees about the origin along your desired plane of rotation.
  6. 现在沿着所需的旋转平面将对象绕原点旋转180度。

  7. Translate back to p0.
  8. 转回p0。

This should give you a reflection of the object about the line you wish to rotate around.

这应该可以反映出您想要旋转的线的对象。