This content has been marked as final. Show 7 replies
you want to curve from where (anchor point) to where (anchor point) and you want the lines from where (controlX,controlY) to each of your anchor points to be tangent to your curve at the anchor points?
this is where i really get confused :(
If i want the curve start from 2 (the same as the line) but i want it to end up curving at a nice point to say 145 how would i do this?
Sorry im probably being really dense i have no idea abouot anchor points
2 is not a start point and 145 is not an end point. you must designate an x and y coordinate for each point in 2d space.
anchor points are the start and end point. they anchor (or fix) the ends of your curve.
the shape of the curve is determined by the control point. specifically, the shape is determined by the slope of the curve at each anchor point and smoothly making the transition from one anchor to the other.
thats a really helpful breakdown i just cant put theory into practice with my graph, i know what i want it to look like curve wise but gettng the correct poiints etc is another matter lol
what two points (x and y coordinates are needed for each) do you want to connect and how do you want the curve to look?
ONt he movie clip the point a want it to go from is: x: 77.0 y:195.0 i would like it to connect to a point at 112.0 and 185.0. Form here i will continue the code with a lineTo.
The graph will finally look like this: http://www.tech.plymouth.ac.uk/research/lt_area/images/tensile_graph.jpg the curve bit needs to be from just under the 3500 point to just under the 4000 point under 2 on the x axis.
I did a graph just using lineTo but it just looked too blocky and they want a nice small curve instead!
Easy said than done its my first actionscript project!
Thank you for your help :)
to start from (77,195) you need to use moveTo(77,195) or lineTo(77,195) or a previous curveTo(xx,yy,77,195) before using your curveTo(xxx,yyy,112,185). i'll use moveTo() in the code below.
next you want to determine your control point (which determines the curves shape). a straight line would have control point right on the line that connects those two points (and if the curve is symmetric between those two points): (94.5,190). that point is in the middle of the line segment connecting your two points
if you want a curve that has a lot of arc use a control point way above (94.5,190) like (94.5,-390) or (94.5,-1000), to curve downwards, for example.
because you want a curve that has a gentle arc, pick a control point just above (94.5,190) like (94.5,180). the closer the y coordinate of the control point is to 190 the more gentle the curve. if the control point 's y is above 190, the curve will arc downwards. if the control control point's y is below 190 the curve will arc up.