-
Drawing an arc dynamically
Hi guys,
I want to draw a dynamic arc on mouse move using Actionscript. If, I click and drag on stage, allow him to draw anything and in the end when mouse is released, i want to make that as arc. I can get the start and end point at mousedown and mouseup, point is how to calculate the angle and make it as arc on mouseup. will curveTo will help.
-
Senior Member
flash's curveTo draws bezier arc. it looks like this:
so yes, if that's what you mean by arc, it will help. if you mean circle arc, you still could use multiple curveTo-s to draw it approximately. in either case, you will first have to decide how to deal with user input that does not resemble arc. commonly used method for this is least squares, but I bet the formula will turn out rather complex for the arc (edit: check this paper), so you should try something else.
Last edited by realMakc; 10-07-2013 at 11:44 AM.
-
Senior Member
Originally Posted by realMakc
if you mean circle arc, you still could use multiple curveTo-s to draw it approximately
like this
-
Senior Member
Originally Posted by realMakc
wait, that's lineTo-s
-
Senior Member
Had enough inspiration to actually try and do this: http://wonderfl.net/c/5B1p/read It does full circle (not arc) but I'm sure it's enough to get you started
-
Originally Posted by realMakc
flash's curveTo draws bezier arc. it looks like this:
so yes, if that's what you mean by arc, it will help. if you mean circle arc, you still could use multiple curveTo-s to draw it approximately. in either case, you will first have to decide how to deal with user input that does not resemble arc. commonly used method for this is least squares, but I bet the formula will turn out rather complex for the arc (edit: check this paper), so you should try something else.
Hi, thanks for reply, will try if i can get any from the link you posted, thanks a lot.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|