Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Drawing a line between two points via another point

Author
Message
John Y
Synergy Editor Developer
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: UK
Posted: 24th Nov 2007 13:45 Edited at: 24th Nov 2007 13:45
Hi Guys,

I am working on a project that requires the functionality shown in the picture. A line must be drawn between two points (the blue circles to the safe icon), but it also must pass through another point (the hand icon)

what's the best way of doing this?



Synergy Editor - Available in the WIP forum

Attachments

Login to view attachments
MonoCoder
18
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 24th Nov 2007 14:15
I think you'll be needing to do stuff along these lines:

first, your curvy line becomes 2- a line from the blue circle to the hand, and a line from the hand to the safe. The end of the first line and the start of the second become the left and right sides of the hand. The start of the first line is the centre of the blue circle.

The end of the second line will be the centre of the safe, plus a radius from it, at the angle between the it and the hand.

From there, you'll need a bezier line function (or whatever else suitable for curvy lines), to draw the two lines.




Hope that helps.

EBA; FUI; Mario Land Ripoff.
Every time you post a joke in the form of code, mace yourself.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 24th Nov 2007 15:58
@John,
Google for splines - they look like they may work the way that you need them too. Maybe you can drop an email to Ravey - he showed us a great application of splines in his talk at the conference.

Utility plugins collection and
http://www.matrix1.demon.co.uk for older plug-ins and example code
John Y
Synergy Editor Developer
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: UK
Posted: 25th Nov 2007 11:12
Thanks guys, will try out your suggestions.

Synergy Editor - Available in the WIP forum

Login to post a reply

Server time is: 2024-05-17 12:01:48
Your offset time is: 2024-05-17 12:01:48