(05-09-2023, 08:14 PM)mnrvovrfc Wrote: I made changes so "xs", "ys" and "scale" and the local "x" and "y" of the subprograms were single-prec. It didn't make a lot of difference in the program output.
Thankyou, you saved me from that very experiment
I also tried a pixel off set in my code in attempts to draw patterns on diagonals but something was wrong minded how I did it.
I think setting a background black color 1/3 to 2/3 of time might make colorful tessellations more "meaningful" by looking more like an object with a background instead of a wall texture as James has done tiles of balls.
Update: Yeah with black background more often it looks more "patternly" Limiting colors is maybe a rabbit hole? But here in Tessellations 2 I use 2 pallets for color filled tiles. One pallet is in blues and white then other darker red, green, yellow/brown:
Code: (Select All)
_Title "Tessellation 2 use b to toggle to 1 color and black or full color"
' b+ 2023-05-09 - Tiling with a pattern
' Tessellation 2 will try color filled with more background black.
'
' Inspired by Charlie's BAM example:
' https://staging.qb64phoenix.com/showthread.php?tid=1646&pid=15772#pid15772
'
' But I also wanted to try a colorized version.
'
' So use b key to toggle between:
' 1. a mod of Charlies version with different pixel block size with black backgrounds
' 2. the colorized version which reminds me of Magic Eye Art
'
DefLng A-Z
Screen _NewImage(800, 600, 12) ' only 16 colors here
_ScreenMove 250, 50
Dim Shared Pix ' Pix is number of pixels to Tile side
Dim Shared Scale ' Change a pixel to a bigger square block for not so subtle patterns
Dim Shared Tile ' Handle that stores Tile Image in memory to call up with _PutImage
Dim Shared B ' Set color mode from Full 16 colors Rainbow to 1 like for printing a label
Do
If InKey$ = "b" Then B = 1 - B ' toggle coloring mode on a b keypress
MakeTile ' create a new random tiling pattern
Tessellate ' tile the screen with it
_PrintString (740, 580), "ZZZ..." ' Show user we are sleeping awaiting a key press
Sleep
Loop Until _KeyDown(27) ' quit when detect escape key on sleep
Sub MakeTile ' make a random tile to Tesselate according to B Mode coloring
Pix = 8 'Int(Rnd * 9) + 4 ' sets tile size: pix X pix or a 4X4 to 12X12 Tile coloring
Scale = Int(Rnd * 6) + 4 ' to change pixels to square blocks
If Tile Then _FreeImage Tile ' throw old image away
Tile = _NewImage(Scale * Pix - 1, Scale * Pix - 1) ' make new one
_Dest Tile ' draw in the memory area Tile not on screen
oneColor = Int(Rnd * 15) + 1 ' one color and black background for B Mode
pall = Int(Rnd * 2)
For y = 0 To Scale * Pix - 1 Step Scale
For x = 0 To Scale * Pix - 1 Step Scale
If B Then
If Rnd < .5 Then c = 0 Else c = oneColor 'one color and black background for B Mode
Else
If Rnd < .5 Then c = 0 Else c = 2 * Int(Rnd * 8) + 1 + pall
End If
Line (x, y)-Step(Scale, Scale), c, BF ' this should be integer since Tile is
Next
Next
_Dest 0
End Sub
Sub Tessellate ' just covering the screen with our Tile
For y = 0 To _Height Step Scale * Pix
For x = 0 To _Width Step Scale * Pix
_PutImage (x, y)-Step(Scale * Pix - 1, Scale * Pix - 1), Tile, 0
Next
Next
End Sub
Tess 2 pal 1, one of them:
Tess 2 pal 2, the other pal:
b = b + ...