1
$\begingroup$

How can I remodel a line, i want to draw first a line then i want to remodel the line such as in paint software, which algorithm should I use? Are there several algorithms to achieve this? i am using the bresemhan algorithm

For example i have this line, but when i will click in the center and with the mouse i want to pull

enter image description here

$\endgroup$
7
  • 5
    $\begingroup$ I find it hard to understand what exactly you want to achieve. I guess you draw a straight line and then "pull" to make it a curve? If you add a sketch or two, it might help. $\endgroup$
    – Tare
    Sep 2, 2020 at 7:33
  • $\begingroup$ @Tare i edited my question $\endgroup$
    – hubman
    Sep 2, 2020 at 14:42
  • 1
    $\begingroup$ From quickly reading up on the Bresenham algorithm, it has little to do with with your line you want to draw. You also don't mention the framework you're using, so this is still tricky to answer. However, the two things that come to mind when creating a curved line based on certain points are Splines and Bezier Curves. Your points would be the start and end point from your first line drawing, plus either the center or the point closest to the mouse click when pulling (and then to wherever you pull it). Based on that, you should be able to get a curve $\endgroup$
    – Tare
    Sep 3, 2020 at 5:46
  • 1
    $\begingroup$ @hubman i dont know sure, but bezier curves is used to 2d and 3d. $\endgroup$ Sep 5, 2020 at 21:35
  • 1
    $\begingroup$ In theory you could just use the Bezier Curve in any plane and then project it into your 3D world. If you want to use it for surfaces, there are Bezier Surfaces (see en.wikipedia.org/wiki/B%C3%A9zier_surface ). If you just want a curve going through all 3 dimensions, there are some sources for that as well (see mathcurve.com/courbes3d.gb/bezier3d/bezier3d.shtml ). So I guess any way you look at it you should be fine in 3D. $\endgroup$
    – Tare
    Sep 7, 2020 at 7:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.