Showing posts with label XNA Path Bezier Curve Editor. Show all posts
Showing posts with label XNA Path Bezier Curve Editor. Show all posts

Sunday, February 13, 2011

XNA Bezier Curve Editor Demo

Here is a quick look at the Bezier Curve editor I made in XNA that uses the function from my prior blog . Note there are circular Paths each withe 3 segments. Each segment is a 4 point Bezier calculation.


The basic tricks in getting this to be a smooth curve across the whole path is to:

  1. p3 of the each segment is in common to p0 of next each segment.
  2. To make the circular, p3 of last segment must be same as p0 of 1st segment.
  3. p2 and p3 of each segment must be on a strait line with p0 and p1 or the next segment. So this means
    • If a path point was moved by user, you must also move left and right control handler points by same deltas
    • If left handler moved,  must also move corresponding path point so it intersects line to other handler at mid point
    • If right handler moved, must also move corresponding path point so it intersects line to other handler at mid point