Home > Degrafa, Flex > Degrafa Dynamic Quadratic Bezier

Degrafa Dynamic Quadratic Bezier

January 2, 2009

This demo shows how to define a Degrafa quadratic Bezier in MXML without any control points.  The control points are graphically created via MXML components.  As the graphic markers are dragged, the actual Bezier control points are set via script.

Jason’s cool dashed-line decorator is used in another MXML component to draw the convex hull of the control points.

Defrafa Quadratic Bezier

Defrafa Quadratic Bezier

To use the demo, drag the ‘A’, ‘B’, and ‘C’ control points to alter the quadratic Bezier curve.  The MXML components in this demo will be used again in an upcoming discussion on arc length of the quad. Bezier.

View demo

View source

Note – I dumped everything in ‘view source’, so focus your attention on the src folder.  You will also want to download the Degrafa demo template (I did make some changes to the css file).

Categories: Degrafa, Flex Tags: , , ,
  1. January 2, 2009 at 11:55 am

    awesome demo Jim! It would be cool to see the actual x0,y0,cx,cy,cx1,cy2,x1,y1 points being displayed.

    I like the (unintentional?) effect of the dashed line decorator animating when you click down on a control point.

  2. January 2, 2009 at 4:08 pm

    Tom – ‘A’ = (x0,y0), B = (cx,cy), and C = (x1,y1).

    The animating effect on the decorator is an artifact of that particular decorator – it is kind of cool🙂

    regards,

    – jim

  1. No trackbacks yet.
Comments are closed.
%d bloggers like this: