Jump to content
  • Advertisement
Sign in to follow this  
hupsilardee

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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].

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!