![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
SharkD wrote:
> Also, none of these aspect ratios still match the aspect ratio. You need to
> multiply the height of the image by 2*cos(30). Is there a formula you used to
> determine "close" matches? Maybe I can adapt that.
Where did you get the factor of 2?
+ +
(-1,0) + +(0,0) + (1,0)
+ +
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Dan Connelly <djc### [at] yahoo com> wrote:
> SharkD wrote:
> > Also, none of these aspect ratios still match the aspect ratio. You need to
> > multiply the height of the image by 2*cos(30). Is there a formula you used to
> > determine "close" matches? Maybe I can adapt that.
>
> Where did you get the factor of 2?
>
> + +
>
>
>
> (-1,0) + +(0,0) + (1,0)
>
>
>
> + +
Ah, sorry. I didn't explain things thoroughly enough. In order for the image to
be tilable, you have to cleverly select a *portion* of the hexagon--you can't
just select the entire thing! This *portion* happens to have double the aspect
ratio. Actually, there is another option, but the resulting image can't be made
as small.
Here is a graphic:
http://img505.imageshack.us/img505/1075/tileablehexagonvo7.png
The blue rectangle is the minimum area that can be tiled to produce a repeating
hexagon (assuming that the hexagon doesn't also have any greebles that result
in it being asymmetric).
-Mike
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"SharkD" <nomail@nomail> wrote:
> Ah, that's a clever trick. I will definitely try that. I'm not sure how to
> calculate the proper "correction" to introduce the correct level of distortion,
> though.
>
There is no correction to calculate, just set your camera vectors to the proper
ratios for the actual hex pattern.
>
> I'm talking resolutions of 200px or less. The image is meant as a background
> image for an HTML page.
>
> Also, none of these aspect ratios still match the aspect ratio. You need to
> multiply the height of the image by 2*cos(30). Is there a formula you used to
> determine "close" matches? Maybe I can adapt that.
>
> -Mike
You are right about the ratio. The 2:2cos(30) ratio I've been using is the
ratio of hex width to height, but for tiling of a hex pattern it should be
3:2cos(30) or 2cos(30):1.
To get the values I basically just used an excel spreadsheet to calculate and
tabulate the values.
Best ratios under 1600 width:
1351 x 780 ( 0.000027% )
989 x 571 ( 0.000102% )
362 x 209 ( 0.000382% )
724 x 418 ( 0.000382% )
1086 x 627 ( 0.000382% )
1448 x 836 ( 0.000382% )
627 x 362 ( 0.000382% )
1254 x 724 ( 0.000382% )
1519 x 877 ( 0.000563% )
1545 x 892 ( 0.000691% )
892 x 515 ( 0.000691% )
1183 x 683 ( 0.000786% )
1157 x 668 ( 0.000859% )
821 x 474 ( 0.000964% )
1422 x 821 ( 0.000964% )
Best ratios ranked by size:
1351 x 780 ( 0.00003% )
989 x 571 ( 0.00010% )
362 x 209 ( 0.00038% )
265 x 153 ( 0.00142% )
97 x 56 ( 0.00531% )
71 x 41 ( 0.01984% )
26 x 15 ( 0.07399% )
19 x 11 ( 0.27663% )
7 x 4 ( 1.02567% )
-tgq
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Trevor G Quayle" <Tin### [at] hotmail com> wrote:
> There is no correction to calculate, just set your camera vectors to the proper
> ratios for the actual hex pattern.
Awesome! Thanks!
> You are right about the ratio. The 2:2cos(30) ratio I've been using is the
> ratio of hex width to height, but for tiling of a hex pattern it should be
> 3:2cos(30) or 2cos(30):1.
Actually, you were correct to begin with!!!! :) I looked at it again and
realized the method I described only reproduces the "isometric" pattern of
intersecting lines (which is sufficient for my needs). To reproduce the actual
*hexagon* in its entirety you need to take things a step further:
http://img505.imageshack.us/img505/1909/tileablehexagon2rn5.png
> To get the values I basically just used an excel spreadsheet to calculate and
> tabulate the values.
Thanks for the tip! I was hoping for an algorithmic approach, but I guess
there's no real need to go to all that effort.
Thanks again!
-Mike
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"SharkD" <nomail@nomail> wrote:
>
> > You are right about the ratio. The 2:2cos(30) ratio I've been using is the
> > ratio of hex width to height, but for tiling of a hex pattern it should be
> > 3:2cos(30) or 2cos(30):1.
>
> Actually, you were correct to begin with!!!! :) I looked at it again and
> realized the method I described only reproduces the "isometric" pattern of
> intersecting lines (which is sufficient for my needs). To reproduce the actual
> *hexagon* in its entirety you need to take things a step further:
>
> http://img505.imageshack.us/img505/1909/tileablehexagon2rn5.png
>
OK I need to go through step by step.
If we want a hex pattern that is purely tileable (no mirroring) using your
image, the width is the same as the green area:
W=2*cos(30)
the height should actually be twice what your green area is:
H=2+2*sin(30)
=2+1
=3
W/H=2*cos(30)/3 or 1/2*cos(30)
The green box you have drawn is:
W/H=4*cos(30)/3 or 1/cos(30)
but this only works if you mirror the pattern on the x-axis
and if you want to mirror across both the x and y axis, you may as well cut the
width in half again which is the same as the first ratio:
W/H=2*cos(30)/3 or 1/2*cos(30)
So it depends on how you intend to map you pattern. Usually desktop tiling
doesn't mirror so you would want tne first ratio for a directly tileable
pattern. I hope this clarifies things a bit.
-tgq
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
SharkD wrote:
> Actually, you were correct to begin with!!!! :) I looked at it again and
> realized the method I described only reproduces the "isometric" pattern of
> intersecting lines (which is sufficient for my needs). To reproduce the actual
> *hexagon* in its entirety you need to take things a step further:
So we're back with sqrt(3)/2 (or 2/sqrt(3)) ?
> Thanks for the tip! I was hoping for an algorithmic approach, but I guess
> there's no real need to go to all that effort.
>
This is what I did:
% perl -e 'my $fmin = 10; for (my $n = 1; $n < 10000; $n ++) { my $m = int(sqrt(3) / 2
* $n + 0.5); my $f = abs( $m / $n / (sqrt(3) / 2) - 1); if ($f < $fmin) { $fmin = $f;
$n0 = $n; $m0 = $m; printf "%6d %6d %g\n", $n0, $m0, $fmin } }'
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Trevor G Quayle wrote:
> "SharkD" <nomail@nomail> wrote:
>>> You are right about the ratio. The 2:2cos(30) ratio I've been using is the
>>> ratio of hex width to height, but for tiling of a hex pattern it should be
>>> 3:2cos(30) or 2cos(30):1.
>> Actually, you were correct to begin with!!!! :) I looked at it again and
>> realized the method I described only reproduces the "isometric" pattern of
>> intersecting lines (which is sufficient for my needs). To reproduce the actual
>> *hexagon* in its entirety you need to take things a step further:
>>
>> http://img505.imageshack.us/img505/1909/tileablehexagon2rn5.png
>>
>
> OK I need to go through step by step.
>
> If we want a hex pattern that is purely tileable (no mirroring) using your
> image, the width is the same as the green area:
> W=2*cos(30)
> the height should actually be twice what your green area is:
> H=2+2*sin(30)
> =2+1
> =3
>
> W/H=2*cos(30)/3 or 1/2*cos(30)
>
> The green box you have drawn is:
> W/H=4*cos(30)/3 or 1/cos(30)
> but this only works if you mirror the pattern on the x-axis
>
Actually, it works without mirroring, but you need to offset every
other line by half the width of the green area.
Jerome
- --
+------------------------- Jerome M. BERGER ---------------------+
| mailto:jeb### [at] free fr | ICQ: 238062172 |
| http://jeberger.free.fr/ | Jabber: jeb### [at] jabber fr |
+---------------------------------+------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkkl16wACgkQd0kWM4JG3k8WMQCfVoSAEPLSZMdpoil3FtMuLx7/
6YIAniN3pvcDibyQ64fWRHUFoXNAmTv+
=imnu
-----END PGP SIGNATURE-----
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Can someone post some sample code here regarding this issue?
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Trevor G Quayle" <Tin### [at] hotmail com> wrote:
> So it depends on how you intend to map you pattern. Usually desktop tiling
> doesn't mirror so you would want tne first ratio for a directly tileable
> pattern. I hope this clarifies things a bit.
>
> -tgq
Duh. That's what I get for not getting any sleep last night. :) Yes, I was
mirroring everything, which does not work on desktops or web pages. Doubling
the width (or the height) of the green box makes it so that it works without
mirroring.
-Mike
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"SharkD" <nomail@nomail> wrote:
> "Trevor G Quayle" <Tin### [at] hotmail com> wrote:
> > So it depends on how you intend to map you pattern. Usually desktop tiling
> > doesn't mirror so you would want tne first ratio for a directly tileable
> > pattern. I hope this clarifies things a bit.
> >
> > -tgq
>
> Duh. That's what I get for not getting any sleep last night. :) Yes, I was
> mirroring everything, which does not work on desktops or web pages. Doubling
> the width (or the height) of the green box makes it so that it works without
> mirroring.
>
> -Mike
Duh again. Only doubling the height works. Time for bed. :)
-Mike
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |