Jump to content
  • Advertisement
Sign in to follow this  
wasted_druid

bezier splines

This topic is 4722 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been reading up on bezier splines, and I'm assuming that's what photoshop uses for it's "pen tool". I can't, however, figure out how they get their little control bars to work. Is it actually a different kind of spline? Any information on the math behind that nifty little tool would be appreciated.

Share this post


Link to post
Share on other sites
Advertisement
I don't know for sure that they're using Bezier splines, but they probably are. The way it would work is every curve is a piecewise 3rd order Bezier curve. That is, each set of 4 points is a convex hull for the Bezier curve. The two interior points are the control bar points, one attached to each endpoint. The two endpoints are, well, the endpoints. When you have, say, 3 points that the piecewise curve passes through...what you actually have internally is two 3rd order Bezier curves. One that joins the first 2 of the piecewise curve points----which adds two control bar points between the first 2 points, and a second Bezier curve that joins the middle and last piecewise curve points, adding an additional two control bar points beween the last 2 piecewise curve points. Now, with the 2 Bezier curves, notice that the middle piecewise curve point is attached to 2 control points. You can do cool constraints with those 2 control points to get the different controls in Photoshop. For example, if you require that the 2 control points be colinear with the middle piecewise curve point, then your overall curve will be smooth/continuous at that middle point and it'll look like you have just one big smooth curve. Or, you can free up the control points and let them move freely, in which case the overall curve will have a discontinuous point---a corner---in the middle of it at that middle point.

Hope this helps!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!