# Transforming an ellipsoid

This topic is 2567 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I want to transform an ellipsoid according to some arbitrary matrix (4x4, DirectX oriented).
My ellipsoids are represented by a Vector3 for the centre, and a Vector3 for the axial radii.
Now, it's obvious to me that the centre should transformed by multiplying the Vector4(centre.x, centre.y, centre.z, 1) by the matrix, and then taking the x, y, z components of the result as the new coordinates of the centre. However, I am not sure how to handle the radii.

Should they be individually scaled, simply by multiplying by the upper left 3x3 sub-matrix? Or should they be divided by the determinant? Or is it something even more complex?

##### Share on other sites
Going by your definition, your ellipsoids are always axis-aligned (since the radii are always assumed to be along the x,y,z axes). If this is intentional, and all you want to use your transformation matrix for is translation and scaling, then it would be sufficient to multiply your center vector with the translation column of your matrix and your axial radii vector with the matrix diagonal. You wouldn't even need a matrix, just a translation- and a scale-vector.

However, if you want to be able to rotate your ellipsoids, then you will probably have to refactor your definition to allow non-axis-aligned ellipsoids...

##### Share on other sites
No, I'm fine with keeping them axis aligned, but what do I do when there is a rotation component in the matrix? (These are bounding ellipsoids, which need to be transformed into world space before frustum culling is performed).
So do I transform the centre as described below, then multiply the axial radii by the first three diagonal elements?

##### Share on other sites
Axis-aligned ellipsoids (AAEs) might not be a very good choice for bounding volumes. When you apply a rotation to an AAE, the result is no longer an AAE. So you'll need to compute an AAE large enough to contain all of the non-axis aligned ellipsoid that resulted from the transformation, but this won't be a tight it at all. Perhaps you should recompute a bounding ellipsoid after transforming your model. Axis-aligned bounding boxes have the same issue.

Or perhaps you should use arbitrary ellipsoids instead, or some other [url="http://en.wikipedia.org/wiki/Bounding_volume#Common_types_of_bounding_volume"]type of bounding volumes[/url].

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 11
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633722
• Total Posts
3013540
×