3D 成像:根据 3 个给定的平行于笛卡尔平面的椭圆定义椭圆体

发布于 2024-10-04 04:43:04 字数 520 浏览 4 评论 0原文

对于 3D 成像软件,我正在编码:

我需要定义一个椭球体 E,它可以在空间中具有任何半径、中心和旋转 alt text

用户界面允许用户控制 3 个椭圆,它们是椭球体的“切片”(红色、绿色、图像中的蓝色),并且(根据定义)平行于主笛卡尔平面(xy,yz。 xz)

这 3 个椭圆是整个椭圆体的一部分,并定义了整个椭圆体 alt text

每个切片都可以在空间中拖动、调整大小或旋转,并且 每个切片都是完全定义的:它是中心在空间中的 3d 位置,它是 2 个半径,它是距轴平面的距离。

显然,每个变化都会影响椭球 E 和其他 2 个派生椭圆的参数。

我需要根据对切片所做的更改重新计算椭球 E 的方程

(椭球方程的首选类型应该可以轻松导出 XY 椭圆切割(变量 z))

有什么想法吗? 提前致谢 萨尔

for a 3d imaging software i am coding:

I need to define an ellipsoid E, which can have any radii, centers and rotations in space
alt text

the user interface allows the user to control 3 ellipses, which are "slices" of the ellipsoid (red,green,blue in the image) ,and are parallel (by definition) to the main Cartesian planes (x-y, y-z.
x-z)

these 3 ellipses are part of, and define, the whole ellipsoid
alt text

each slice can be dragged, resized or rotated in space and
each slice is fully defined: it's center's 3d position in space, it's 2 radiuses, it's distance from the axis planes.

each change should, obviously, affect the parameters of the ellipsoid E, and the other 2 derived ellipses.

i need the equation to re-calculate ellipsoid E based on the changes made to a slice

(The preferred type of equation for the ellipsoid should make it easy to derive the X-Y ellipse cuts (variable z))

any ideas?
thanx in advance
Saar

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

予囚 2024-10-11 04:43:04

我认为这个问题的关键是将初始椭圆方程重写为矩阵形式xTAx,其中 x = {x,y,z} 且 A 为正定。采用

Ellipsoid matrix.

我们可以通过 相似度变换。因此,更新后的矩阵为 A' = UTAU,其中 U正交矩阵UT是它的转置。然后使用 A' 更新其他视图。

从绕三个轴的旋转矩阵开始

绕三个轴的旋转矩阵。

我们可以非常清楚地看到,绕三个轴的旋转轴将影响 A 中的 8 个项。由于 A 是对称的,因此可以减少到仅更改 6 项中的 5 项。缩放/拉伸也很容易完成。

我们首先假设拉伸是沿着 x 轴(或任何适当的轴)进行的,因此 S 是一个对角矩阵,其对角线为 {sqrt( s ), 1, 1},其中 s是施加的拉伸量。然后将缩放矩阵旋转到正确的应用方向,即RTheta S RThetaT,其中Theta为正 x 轴与顺时针方向拉伸方向之间的角度。请注意此处旋转的相反顺序,因为 RThetaT 可以被认为是旋转坐标,以便 S 拉伸 x 轴,RTheta 将它们向后旋转。例如,如果 xy 平面沿 x = y 重新缩放 s 倍,则

缩放矩阵

S 以与旋转相同的方式应用于 A,并且同样可以直接看出,除了 zz 项之外的所有项都直接受到缩放操作的影响。

I think the key to this problem is to rewrite the initial ellipse equation in matrix form: xTAx, where x = {x,y,z} and A is positive definite. Taking

Ellipsoid matrix.

we can update A via a similarity transform. So that, the updated matrix is then A' = UTAU where U is an orthogonal matrix and UT is its transpose. Then A' is used to update the other views.

Starting with the rotation matrices about the three axes

Rotation Matrices about the three axes.

we can see quite clearly that a rotation about the axes will effect 8 terms in A. Since, A is symmetric this is reduced to only changing 5 out of 6 terms. Scaling/stretching is also very easily done.

We start by assuming that the stretch is along the x-axis (or any appropriate axis), so that S is a diagonal matrix with a diagonal {sqrt( s ), 1, 1}, where s is the amount of stretch applied. Then scaling matrix is rotated into the correct direction of application, i.e. RTheta S RThetaT, where Theta is the angle between the positive x-axis and the stretch direction in a clockwise fashion. Note the reverse order of the rotations here, as RThetaT can be thought of as rotating the coordinates so that S stretches the x-axis and RTheta rotates them back. For example, if the x-y plane is rescaled along x = y by a factor of s, then

scaling matrix

S is applied to A in the same way as the rotations, and, again, it is straightforward to see that all but the zz terms are directly affected by the scaling operation.

錯遇了你 2024-10-11 04:43:04

这里有一个棘手情况的示例:

一个真正的椭球体和一个球体,其与三个坐标平面的交点是点。在此示例中,您无法决定应映射哪个二次曲面。

替代文本

替代文本

这些曲面的方程为:

 (-1 + x)^2 + (-1 + y)^2 + (-1 + z)^2 == 1  

并且

1/8 (12 + 3 x^2 + 3 y^2 - 2 y (2 + z) - 2 x (2 + y + z) + z (-4 + 3 z)) == 1

因此,由于您的解不是唯一定义的,因此您无法根据三个交点重建椭球体。我认为你问题的其他答案不考虑翻译。

Here you have an example of an intractable situation:

One true allipsoid and an sphere whose intersections with the three coordinate planes are points. In this example, you are not able to decide which quadric you should map.

alt text

alt text

The equations for these surfaces are:

 (-1 + x)^2 + (-1 + y)^2 + (-1 + z)^2 == 1  

and

1/8 (12 + 3 x^2 + 3 y^2 - 2 y (2 + z) - 2 x (2 + y + z) + z (-4 + 3 z)) == 1

So, as your solutions are not uniquely defined, you can't reconstruct your ellipsoid based on the three intersections. I think other answers to your question do not account for translations.

深海夜未眠 2024-10-11 04:43:04

如果在给定实例中,3 个椭圆表示 E 的“笛卡尔”切割,则对其中任何一个(平移、缩放、旋转)进行一次修改即可重新定义唯一的椭圆体。幸运的是,有一只鼠标(或单个可识别的按键)
或者对这件事有一个想法..

If, at a given instance, the 3 Ellipses represent "Cartesian" cuts of E, a single modification of any of (pan, zoom, rotate) of any of them redefines a unique ellipsoid. Luckily there is one mouse (or single recognized Keystroke)
or one mind for this matter..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文