Bezier Curve Merging Algorithm?

camelCase

The Case of the Mysterious Camel.
Reaction score
362
I recently got interested in bezier curves and looked it up on wikipedia; my math literacy is almost zero but I did manage to understand the mechanical side of bezier curves (I have no idea why or how they work, I just know they work).

I managed to implement it and see it in action in Unity 3D which was satisfying, then I thought of having an object follow a bezier curve and dynamically being able to create curves and merge them.

But I don't know how to even begin merging bezier curves in a way that would look "right".
I tried googling for the algorithm because I suck at math and just wanted the result and someone suggested "de Casteljau subdivision". Googling it brought me more mathy stuff that I will never understand in my lifetime and continued searches on merging two bezier curves brought me to blender, AS3 and HTML5 sites.

So..
Assuming I have two bezier curves of arbitrary and differing orders, how would I merge them?
If that's not possible, what about two curves of order 5?
If still not possible, what about two quadratic bezier curves?
 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,678
For Beizer curves, if you're working in a 2D environment, I suggest you use a quadratic equation with the order of 2. or 3D, you use the order of 3. (Or so I've heard..)

If you want to merge two or more Beizer Curve, you can try either:

  1. Average each result of the equation per (delta T). And then assume each result is a new Beizer point at given time of reference.
  2. Connect the Beizer Curves together to form a long string of end results given from the equation at (delta T). You start from X, move towards Y, end at Z. And then you set X as Z, and start over, move towards Y', and end at Z'.
I may not have given you the correct answer. You may try asking in other places where real mathematicians and programmers lurk, such as GameDev.net, where I also lurk in.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top