views:

43

answers:

2

I have lot of points (which together form a 3d ellipse) in a given frame (X, Y, Z) and then I have vector (u,v,w). What I want is to orient the ellipse along the vector (u,v,w) . Anyone has useful thoughts on how to go about doing that?

+1  A: 

Well I assume you can reverse engineer the ellipse equation by seeing what fits into either 4 or 5 points (I can't remember which -- but it should be easy to figure out from the equations.) Once you have that you can know the two major axes, and center point for the ellipse and the transformation should be straight forward.

Paul Hsieh
Also, if you already have the frame for the ellipse, you can get the ellipse equation from that instead of a series of surface points
whybird
A: 

Although I support @Paul Hsieh's mathematical approach (and have upvoted it), an alternative brute-force approach which will work for many arbitrary elongated shapes is:

  1. Define the origin as the center of your frame
  2. Find the most distant point from the origin.
  3. Determine rotation that will bring that point into line with your vector.
  4. Apply that rotation to all other points.
whybird