Recommended Posts

ok people. I have been searching about this thing for a while and i found many good tests but most of them i didn't understand.
From what i heard, a Ray-Ellipsoid Intersection Test in exactly like a Ray-Sphere Intersection Test but with converting the ray to ellipsoid space, meaning that you multiply it by a 3x3 matrix that represents the radii of the 3 axises of the ellipsoid.
I just want to know if there is something i missed
here is the quick code

Share this post

Link to post

Share on other sites

I'm not familiar with D3DX calls, but conceptually this is quite simple: Find coordinates in which your ellipsoid looks like a unit sphere, convert the ray to those coordinates, compute the intersection in those coordinates and convert back to the original coordinates. [EDIT: Solving for t and using this value to compute a point in the ray, as you are doing, is perfectly fine too.]

If I am not mistaken, you need to convert the ray to "sphere" coordinates by multiplying by the inverse of the matrix whose columns are the axes of the ellipsoid.

0

Share this post

Link to post

Share on other sites

I'm not familiar with D3DX calls, but conceptually this is quite simple: Find coordinates in which your ellipsoid looks like a unit sphere, convert the ray to those coordinates, compute the intersection in those coordinates and convert back to the original coordinates. [EDIT: Solving for t and using this value to compute a point in the ray, as you are doing, is perfectly fine too.]

If I am not mistaken, you need to convert the ray to "sphere" coordinates by multiplying by the inverse of the matrix whose columns are the axes of the ellipsoid.

great. I just need to multiply the ray's vector and origin by the INVERSE of the matrix not the actual one. Thanks. I thought it was much more complicated