<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>labs.hellokeita.com &#187; Bézier</title>
	<atom:link href="http://labs.hellokeita.com/category/graphics/bezier/feed/" rel="self" type="application/rss+xml" />
	<link>http://labs.hellokeita.com</link>
	<description>Yet another labs blog</description>
	<lastBuildDate>Thu, 01 Dec 2011 20:14:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Multi Bézier Curve</title>
		<link>http://labs.hellokeita.com/2009/03/12/multi-bezier-curve/</link>
		<comments>http://labs.hellokeita.com/2009/03/12/multi-bezier-curve/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 01:56:37 +0000</pubDate>
		<dc:creator>keita</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Bézier]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[as3 bezier]]></category>
		<category><![CDATA[beziercurve]]></category>
		<category><![CDATA[cubic]]></category>
		<category><![CDATA[curve]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[multiple]]></category>
		<category><![CDATA[quadratic]]></category>

		<guid isPermaLink="false">http://labs.hellokeita.com/?p=34</guid>
		<description><![CDATA[What is Bezier?
Simply explaining for dummy AS programmers, is what graphics.curveTo method does.
If you want to learn more, here is the Wikipedia article.
Basically, the curveTo method uses a quadratic bézier, so you need a control point and a anchor point.
But it&#8217;s difficult to find the precise control point for a curve you want, because the [...]]]></description>
			<content:encoded><![CDATA[<p>What is Bezier?<br />
Simply explaining for dummy AS programmers, is what <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/index.html" target="_blank">graphics.curveTo</a> method does.<br />
If you want to learn more, <a href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve" target="_blank">here is the Wikipedia article</a>.</p>
<p>Basically, the curveTo method uses a quadratic bézier, so you need a control point and a anchor point.<br />
But it&#8217;s difficult to find the precise control point for a curve you want, because the control point is not inside the curve.<br />
Also, you just can create a curve with just one control point, or if you want to use many curveTo methods in sequence, sometimes the curve doesn&#8217;t became as straight as you want.</p>
<p>So, I created a class that calculates the control points with multiple values bézier.<br />
You can also get the position in this curve.</p>
<p>Here goes the examples. (you can click and drag the points)</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_SimpleMultiBezier_57984719"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="/files/multiBezier/SimpleMultiBezier.swf" />
	<param name="bgcolor" value="#FFFFFF" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/files/multiBezier/SimpleMultiBezier.swf"
			name="fm_SimpleMultiBezier_57984719"
			width="400"
			height="300">
		<param name="bgcolor" value="#FFFFFF" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object><br />
This is an example using 7 positions, the start and the end anchors and 5 control points.<br />
In the class, there&#8217;s a method that returns me an array with the approximated quadratic bézier values, so I&#8217;m using this values to draw the green line.<br />
You see that it still hard to draw a path that you want.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_InsetMultiBezier_523002843"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="/files/multiBezier/InsetMultiBezier.swf" />
	<param name="bgcolor" value="#FFFFFF" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/files/multiBezier/InsetMultiBezier.swf"
			name="fm_InsetMultiBezier_523002843"
			width="400"
			height="300">
		<param name="bgcolor" value="#FFFFFF" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object><br />
This is the same example, but now the positions are inset in the curve.<br />
Now, it became easier to create a curve line.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_BezierAnim_317692166"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="/files/multiBezier/BezierAnim.swf" />
	<param name="bgcolor" value="#FFFFFF" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/files/multiBezier/BezierAnim.swf"
			name="fm_BezierAnim_317692166"
			width="400"
			height="300">
		<param name="bgcolor" value="#FFFFFF" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object><br />
And here, a animation over the curve.</p>
<p>Sorry for lack of explanation, actually I&#8217;m in vacation now, but I wanted to post this class.<br />
Later I&#8217;ll try to post more examples and uses.</p>
<p>I will try to update my svn with these classes, commented, after I came back from vacation.<br />
So, for now, <a href="http://labs.hellokeita.com/files/multiBezier/BezierTest.zip">here is the source code</a>.</p>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2009/03/12/multi-bezier-curve/&ztz=Multi Bézier Curve'><img src='http://labs.hellokeita.com/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='padding:0px 5px 0px 0px;vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a> <span style='vertical-align:middle'><a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2009/03/12/multi-bezier-curve/&ztz=Multi Bézier Curve'>Vote</a></span>]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2009/03/12/multi-bezier-curve/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

