三维成像:限定根据3椭球体给出椭圆它们平行于笛卡尔平面笛卡尔、椭球、椭圆、平面

2023-09-08 00:44:07 作者:诗和远方

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

for a 3d imaging software i am coding:

我需要定义的椭圆E,这可以有任何的半径,中心和旋转在空间

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

的用户界面允许用户来控制3椭圆形,这是椭圆体(红,绿,蓝的图像中)的片,并且是平行的(根据定义)到主笛卡尔平面(XY,YZ。 X-Z)

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)

这些3是椭圆的一部分,并定义,整个椭

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

每个切片可以拖动,调整大小或在空间旋转, 每个切片完全定义:它在航天中心的三维位置,这是2半径,它是从轴线的平面距离

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.

每次变更应,很显然,影响椭圆E的参数,以及其他2衍生的椭圆

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

(公式为椭球体的preferred类型应该可以很容易地推导出XY椭圆切割(变量z))

(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

推荐答案

我认为,关键这个问题是重写初始椭圆方程中的矩阵形式: X T 斧,其中 X = {X,Y,Z}和 A 是正定的。以

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

我们可以更新的 A 通过相似变换。这样,更新后的矩阵和 A' = U T AU ,其中 U 是正交矩阵和 U T 是它的转置。然后点击 A'用于更新其他视图。

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

我们可以看到很清晰地看出,对轴的旋转将影响8项中的 A 。因为, A 是对称的,这是减少到只有5变化出6项。缩放/拉伸也很容易做到。

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.

我们首先假设拉伸是沿x轴(或任何适当的轴),以使小号是一个对角矩阵,对角线{的sqrt(S),1,1} ,其中s是拉伸的施用量。然后调整矩阵旋转到应用程序的正确方向,即研究西塔 SR 西塔 T ,其中西塔是在正x轴和以顺时针方式拉伸方向之间的夹角。注意旋转的相反顺序在这里,因为研究西塔 T 可以被认为是旋转坐标,以便取值绵延x轴和研究西塔 转回来。例如,如果在xy平面由第一个因素沿X = Y重新缩放,然后

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

取值用于 A 在相同的方式旋转,并再次,它是直截了当地看到所有,但ZZ条款直接受缩放操作。

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.