im looking for a chessboard hatch fill routine in basic or assembler
-
- Posts: 4
- Joined: Sun 04 Sep 2022, 13:21
im looking for a chessboard hatch fill routine in basic or assembler
i need it to do hatching but like a chessboard. the other fill routine i used uses lines, which is no good. any ideas? ive looked everywhere.
Re: im looking for a chessboard hatch fill routine in basic or assembler
You might want to consider switching to Matrix Brandy. I think it can do hatching natively, using the same commands as in Acorn's Graphics Extension ROM. The best place to ask would be at the Distillery Forum.
The only similar thing I've done in BBC BASIC for SDL 2.0 is using the gfxlib library, which allows you to mask one pattern with another, like this.
-
- Posts: 4
- Joined: Sun 04 Sep 2022, 13:21
Re: im looking for a chessboard hatch fill routine in basic or assembler
brandy matrix basic doesnt seem to do this. the gcol command just makes the shape invisible. ill try and run the graphics rom in an emulatorHated Moron wrote: ↑Mon 05 Sep 2022, 12:57You might want to consider switching to Matrix Brandy. I think it can do hatching natively, using the same commands as in Acorn's Graphics Extension ROM. The best place to ask would be at the Distillery Forum.
The only similar thing I've done in BBC BASIC for SDL 2.0 is using the gfxlib library, which allows you to mask one pattern with another, like this.
Re: im looking for a chessboard hatch fill routine in basic or assembler
What exactly are you trying to do? Are you trying to fill an arbitrary shape with a chessboard-style hatch pattern? How is that shape defined, as an outline or a solid figure?
Re: im looking for a chessboard hatch fill routine in basic or assembler
As I mentioned above, the only way I know to do something similar is using gfxlib:
Code: Select all
INSTALL @lib$ + "gfxlib"
INSTALL @lib$ + "aagfxlib"
PROC_gfxInit
REM Draw hatch pattern:
GCOL 4,0
FOR X% = 0 TO 1024 STEP 64
RECTANGLE FILL X%, 0, 30, 1022
NEXT
FOR Y% = 0 TO 1024 STEP 64
RECTANGLE FILL 0, Y%, 1022, 32
NEXT
REM Save hatch pattern:
OSCLI "GSAVE """ + @tmp$ + "hatch.bmp"" 0,0,1024,1024"
hatch%% = FN_gfxLoadTexture(@tmp$ + "hatch.bmp", &1000000)
REM Clear screen:
PROC_gfxClrX(0, 0, 0, 0)
REM Draw shape to be filled:
PROC_aaellipsefill(512, 512, 200, 200, 0, &FFFFFFFF)
REM Fill shape with hatch pattern:
PROC_gfxReversePlotScale(hatch%%, 512, 512, 0, 4)
Re: im looking for a chessboard hatch fill routine in basic or assembler
There's another thread related to this subject here.