PrisonLove
Hard Realist
- Reaction score
- 78
How can I find the points of intersection between a ray and an ellispoid centered at an arbitrary point (i.e. not the origin)?
I simply just cannot do the math or form it into Java code.
So far I know that there is some 4x4 Matrix Q that represents the quadric surface for an Ellispoid, and there is some ray x = P + tu, where P is the ray start point, u is the direction vector (normalized) and t is some variable for a point along the ray. I also know that to get the intersection I need the equation xTQx = 0, where xT is the transpose of x. Expanding this equation out we get:
(P+tu)TQ(P+tu)
My problem is, I can't figure out what Q should be, and even if I did, I simply can't do the math to get the closest intersection point to the ray origin. Any help?
I simply just cannot do the math or form it into Java code.
So far I know that there is some 4x4 Matrix Q that represents the quadric surface for an Ellispoid, and there is some ray x = P + tu, where P is the ray start point, u is the direction vector (normalized) and t is some variable for a point along the ray. I also know that to get the intersection I need the equation xTQx = 0, where xT is the transpose of x. Expanding this equation out we get:
(P+tu)TQ(P+tu)
My problem is, I can't figure out what Q should be, and even if I did, I simply can't do the math to get the closest intersection point to the ray origin. Any help?