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.

Newcomers DBPro Corner / curved lines

Author
Message
Dippy
19
Years of Service
User Offline
Joined: 21st Jun 2005
Location:
Posted: 26th Jun 2005 08:34
Hi everyone. I'm taking on my first real project in DBC: a simple paint program a la ms paint. I would like to be able to create curved lines from straight ones by deforming them with the mouse.
However I'm having some problems with the math involved. Basically, I want the curved line to start and finish at the same coordinates as the straight line but all the points in between depend on the coordinates of the mouse at any given time. I've been trying to work this out for a couple of days now, so any ideas would be appreciated.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Jun 2005 02:13
Depends on what type of curved line you want. If you just want the line to pull out and arc evenly, then that's pretty simple. If you want to be able to pull the edge of the curve closer to one side than the other, then you should look into catmull rom splines or beziers.

PETA - People for the Eating of Tasty Animals
Dippy
19
Years of Service
User Offline
Joined: 21st Jun 2005
Location:
Posted: 2nd Jul 2005 06:09
Well, I want the curve to arc out according to the mouse's position. Say the straight line is AB. If the mouse pointer is closer to A than B then the maximum point should be closer to A than B. Just think of ms paint's curve function without the second click that allows you to curve the line again.

Login to post a reply

Server time is: 2024-11-27 22:40:09
Your offset time is: 2024-11-27 22:40:09