5
$\begingroup$

I have three points P0, P1, P2, which are located on an arbitrarily oriented ellipse in 3D space. I have a square texture map with a circle on it. I would like to render a textured quad (with the obvious UV mapping) so that the circle in the texture map projects onto the ellipse that P0, P1, P2 are on.

How do I calculate the vertices of the quad to project the ellipse correctly?

(Alternately, in addition to P0, P1, P2, I have the Keplerian elements of an elliptical orbit, if that's more straightforward.)

$\endgroup$
  • $\begingroup$ Isn't this slightly under-constrained? If you only have 3 coplanar(?), non-colinear points, won't that allow you to have a circle? (Or do you also have the centre?) $\endgroup$ – Simon F Dec 1 '15 at 13:20
  • $\begingroup$ Are the three points any particular points on the ellipse? e.g. if one is guaranteed to be one end of the major axis, and another is one end of the minor axis, then the problem is trivial. $\endgroup$ – Dan Hulme Dec 1 '15 at 15:16
  • $\begingroup$ Yeah, someone elsewhere pointed out it's underconstrained, and the Keplerian elements are probably more usable. That said, I can arrange for the points to be the end of the major and minor axes if that trivializes the problem. $\endgroup$ – Russell Borogove Dec 1 '15 at 16:43
  • 3
    $\begingroup$ If you have the center and major/minor axis vectors, then the corners of the quad will just be center ± major ± minor. $\endgroup$ – Nathan Reed Dec 2 '15 at 1:10
1
$\begingroup$

I assume that your texture is deemed to belong to the plane of the trajectory.

Looking at the unprojected ellipse, you can map the circle to it by an anisotropic scaling. If necessary, rotate the texture first if there is any orientation requirement.

To achieve this first mapping, you will compute the four corners of a rectangle, presumably related to the frame formed by the ellipse axis.

Then transform those vertices to the global scene coordinates, the same way to transform the ellipse.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.