The MASM Forum

Projects => Game Development => Topic started by: HSE on October 06, 2024, 05:13:18 AM

Title: An Anti-Alised Thick Line: The Double Bresenham's Line
Post by: HSE on October 06, 2024, 05:13:18 AM
Hi al!!

To solve some problems of some thick lines (like Thick Anti-Aliased Lines of arbitrary width (https://masm32.com/board/index.php?topic=12255.0)) a different approach is requiered.

This line use 2 times Bresenham algorithm: one for the line itself and other to calculate extreme lines, wich are prependicular to the main line.

The width from this process is the true intended width, not cuts width.

(https://i.postimg.cc/Rqbpj2v0/thick1.png) (https://postimg.cc/Rqbpj2v0)

Like previously discussed, another problem is to connect lines. For that an additional element is used.

(https://i.postimg.cc/tYWd2cTw/thick2.png) (https://postimg.cc/tYWd2cTw)

The drawing above is only to explain the process, because all happen in a buffer screen and you just can see the result.

(https://i.postimg.cc/DJGmnttK/thick3.png) (https://postimg.cc/DJGmnttK)

Lines can be flat antialiased or pipe (3D). This last is antialiased implicitly.

Still work in progress  :thumbsup:

Note: Source code only for REAL MEN[tm]  :biggrin:

Regards, HSE

Note 2: binary is 32 bits


Title: Re: An Anti-Alised Thick Line: The Double Bresenham's Line
Post by: NoCforMe on October 06, 2024, 05:38:10 AM
Quote from: HSE on October 06, 2024, 05:13:18 AMNote: Source code only for REAL MEN[tm]

HAH!

I must say, though, that it looks good.
Title: Re: An Anti-Alised Thick Line: The Double Bresenham's Line
Post by: HSE on October 09, 2024, 05:41:48 AM
Hi all!

A more efficient process, 100% in a single line.

Updated in first post.

Regards, HSE.