How to paint fast brush-strokes / thick lines?

Blitz3D Forums/Blitz3D Programming/How to paint fast brush-strokes / thick lines?

Danny(Posted 2012) [#1]
What's the fastest/most efficient method that allows you to draw a 'thick line' between two points. For example 100 pixels wide. Also I'd like to have rounded ends (e.g. a filled circle).

I basically want an MSPaint level of drawing option in my program (no AA or soft brushes needed).
But my current method is so slow the performance is below acceptable.
See the (crap) example below:


Any ideas how to go about this a lot better?

Thanks in advance,

Danny

Last edited 2012


Danny(Posted 2012) [#2]
Ok, so I figured out two things to get a photoshop style response in doing variable sized brush-strokes (without the soft edges):

1. Separate mouse coordinate recording from attempting to draw the line at the same time:
- prioritize recording to ensure line-resolution.
- delay and manage drawing not to interfere with recording performance.

2. Draw CURVES instead of (linear) lines - to get a natural smooth (curvy) line without even needing that much (point) resolution.

I can figure out the first, but not sure yet what curve-type would work best in my case..

D.


Danny(Posted 2012) [#3]
Okay, I've scoured the code-archives, but none of those curve-demos actually go 'THROUGH' the control points (except the start & finish point).

So can anyone recommend a curve-type (and code sample?) that would go _through_ the given points and doesn't need 3 or 4 tangent/controllers specified to determine the curvature?

I'm just trying to smooth out an otherwise linear line created by a manual stroke (using mouse or tablet).

Thanks in advance,

Danny.

EDIT: --> Cubic Spline seems to be the one ;)

Last edited 2012