Back to bezier curves

Related to an old topic I made ages ago but I decided not to dig that up
http://www.cplusplus.com/forum/general/104087/

I understand a lot more about bezier curves now but I still can't figure how to create a smooth offset curves when the original curve turns sharply (has cusps). I am using De Casteljau's algorithm right now to break the bezier curve into line segments then offset them by the perpendicular slope after the line is "flat" enough compared to the curve.

This is how I expect it to look all of the time (and it works with smooth curves) http://puu.sh/5vlSx.png but I have problems with sharp turns and the straight line it causes on the offset curve http://puu.sh/5vmie.png. (Blue lines = original bezier curve).

I am guessing I have to measure the angle difference between each point when subdividing and continue dividing until a certain angle is reached but I am not quite sure how to code this correctly, any insight would be great.
Back again!! But with a different question this time (and why make another thread).

This should be an easier question to answer I hope, I am trying to create higher order bezier curve but I am either stuck with creating a 20+ order curve with De Casteljau's algorithm which doesn't seem like the best idea or using piece-wise bezier curves but then I am stuck with certain control points being forced to be on the curve itself (which I don't want).

Any idea what the standard approch to creating higher order bezier curves is without these issues?
> I am trying to create higher order bezier curve
I don't see how that can be an objective

> certain control points being forced to be on the curve itself (which I don't want).
¿why not?


I fail to see what kind of curve you want, but you may want to check out NURBS as it is quite flexible.
I think I posted a picture in my other thread but I will post it here as well. I am trying to make a copy of the fairly well known rhythm game osu!.
http://puu.sh/5S4ym.jpg

That picture should show both my objective (creating a bezier curve that can have a variable amount of control points that can be moved at runtime) and why I don't want them to be fixed on the curve (limits the amount of editing you can do to it). I know there are external libraries for this but the main reason I am doing this is as a learning experience...so I would rather avoid those.

That has to be 1 bezier curve (right?) but I don't see a nice way to accomplish that.

Edit:
Looking into B-Splines right now but I don't know if this is heading in the right direction or not.
Last edited on
iirc you have local control with nurbs, also you can generate discontinuities by touching the knot vector.

about the offset, I'm thinking that maybe you can translate the control points to define the border curves.
Yeah it looks like nurbs would be the best option here. I guess it could just be done with an incremental bezier method but the performance hit would be huge once you get high above a cubic.

Thanks for the advice.
Topic archived. No new replies allowed.