WIP (Work In Progress) | |
![]() |
![]() |
![]() ![]() |
Author | Message |
Robbie_Harrison
Seaman ![]() Joined: 26 October 2017 Online Status: Offline Posts: 3 |
![]() ![]() ![]() Posted: 14 January 2018 at 4:08am |
Hello everyone,
I've come to you for a particular problem I thought I'd never face ever again : Maths ! I was working on some tiles for the game of a friend, and was doing a cell-like pavement that I particularely liked : ![]() once put together, it would make a cool pavement, perfect to make round surface and so on : ![]() the problem being : I don't really know how to make a tile out of it. Out of luck, the first dimension I tried was perfectly the right size, once put into a 32*32 or 16*16 tiles, it fit perfectly, meaning that I could allign the tile without the cell being "cut" : ![]() but obviously, when I tried bigger or smaller cell, it's impossible to make them into 32*32 tiles. So I came here to call for your help : does anyone have any idea how to calculate the dimension of a diamond-shape cell so that it's possible to make it into a 32*32 tile ? Because i've been racking my brain without figuring it out. Thank you ! |
|
![]() |
|
DawnBringer
Commander ![]() ![]() Joined: 11 August 2024 Online Status: Offline Posts: 568 |
![]() ![]() ![]() |
Quick look, don't sue me if I'm wrong! :D
Appears to be a diagonal tiling of square sub-tiles with overlap. So THIS specific pattern must meet the condition t*(p-o) = s Where t = subtiles, p = subtile size, o = overlap & s = tile size. So in your case 4*(5-1) = 16 works (as does 8*(5-1) = 32) 16 and 32 only has 2 as primefactors and can only be divided by 2 or n^2. Which means both subtiles and (subtile size - overlap) must be divisible by n^2. Which means the only 1 pixel overlap possibilities are 2 * (17-1) = 32 4 * (9-1) = 32 8 * (5-1) = 32 |
|
![]() |
|
Robbie_Harrison
Seaman ![]() Joined: 26 October 2017 Online Status: Offline Posts: 3 |
![]() ![]() ![]() |
Hey ! Thanks for the awnser ! Unfortunately I don't think it's right, unless I misunderstood your equations :p.
I tried with a 9 pixel side diamond, but it does not do the trick :/ I feel like 5 pixel large is the only way ; here is two 32*32 tiles put side to side with diamond with 9 pixels large size. ![]() |
|
![]() |
|
Hapiel
Rear Admiral ![]() ![]() Joined: 30 June 2023 Online Status: Offline Posts: 3266 |
![]() ![]() ![]() |
I thought this was going to be simple, but I guess not :/
DB, I followed your rule here, right? The tile in my example has a width of (9-1) and a height of (8), so it's square and should fit in a 16x16 tile... Yet I found this shape by randomly playing around, which only fits in a 33x66 tile... :o ![]() (edit: posted before seeing reply above) |
|
![]() |
|
Axolotl
Midshipman ![]() ![]() Joined: 20 May 2016 Online Status: Offline Posts: 62 |
![]() ![]() ![]() |
It's called tessellation.
The shape's not a diamond at all, have to count every corner (20 by my count) The overlap causes additional problems I think. The math's never gonna be simple. |
|
![]() |
|
eishiya
Commander ![]() ![]() Joined: 04 August 2022 Online Status: Offline Posts: 1109 |
![]() ![]() ![]() |
I suspect we've all misunderstood what DB meant by "overlap". I'm not going to guess.
All this is is a brick pattern turned 45 degrees. So, if one diagonal is split into an even number of rows (just as you'd divide a regular brick pattern into an even number of rows along the vertical), and the other diagonal is split into some number of brick "widths" (just as you'd have an integer number of bricks along the horizontal in a regular brick pattern), you'll have a working pattern. That the bricks intersect with a sawtooth pattern is merely cosmetic and doesn't impact the math at all. In other words, I recommend approaching this from the tile down to the cell, rather than from the cell up to the tile. For example: ![]() On the left, I made four rows and plopped a "vertical" cell boundary every 4 pixels along the other diagonal (4 divides nicely into 32). Since everything divides nicely, it tiles seamlessly. On the right, I just added the sawtooth pattern. |
|
![]() |
|
DawnBringer
Commander ![]() ![]() Joined: 11 August 2024 Online Status: Offline Posts: 568 |
![]() ![]() ![]() |
The formula was about strictly diagonally tiled squares (which the original pattern can be viewed as).
What I forgot to account for is the spacing which is a function of the overlap (and subtile size). Yellow area is overlap. ![]() |
|
![]() |
|
Robbie_Harrison
Seaman ![]() Joined: 26 October 2017 Online Status: Offline Posts: 3 |
![]() ![]() ![]() |
@DawnBringer Oh yeah ! It makes sense now ! Thanks a lot !
|
|
![]() |
|
![]() ![]() |
||
Forum Jump |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |