简体   繁体   中英

Perspective projection of rational bezier

I need a method to project 3d conics to 2d. None of the articles tell how to do this with rational beziers. Another thing I need a method for is moving 3d or 2d conics to 4d or 3d respectively (as in a reverse projection). I read somewhere that rational beziers can be split by moving them to a higher dimension and splitting the resulting non-rational curve with de Casteljau and then moving back. I seem to recall that perspective projection of conic beziers can be represented exactly with conic beziers, and that it may involve splitting into several curves. I don't understand any of the articles on any site on beziers.

Since there aren't any better answers, here's what I can offer off the top of my head...

Perspective transformation can change parabolas into ellipses or hyperbolas and vice-versa, so even though P0, P1, and P2 can be directly mapped, the weights will change.

Assuming a conic with weights (1,w,1), however, the distance along the line from (P0+P2)/2 to P1 at which it intersects the curve is simply related to the weight w, and that lets you find the new weight as follows:

  1. Map P0, P1, and P2 to P0', P1', P2'
  2. Calculate the midpoint M' = (P1'+P2')/2
  3. Inverse map M' to M, and calculate the intersection point I of the line M-P1 with the original curve.
  4. Map the intersection point I to I', to get the point at which the new curve should intersect M'-P1'
  5. Calculate the new weight w' from the position of the intersection I'. The curve gets to I at t=0.5, so w' = (M'-I')/(P1'-I'). Note that this division makes sense, because the vectors being divided are collinear. You can divide their lengths or just the largest coordinate.

If you expand out all the steps, I'm sure there are ways to simplify this procedure.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM