POV-Ray : Newsgroups : povray.general : Tiling hexagons Server Time
30 Jul 2024 20:20:24 EDT (-0400)
  Tiling hexagons (Message 19 to 28 of 28)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: SharkD
Subject: Re: Tiling hexagons
Date: 20 Nov 2008 18:45:00
Message: <web.4925f5721539762d5c688edf0@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> 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

From: SharkD
Subject: Re: Tiling hexagons
Date: 20 Nov 2008 18:50:00
Message: <web.4925f6e51539762d5c688edf0@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> "Trevor G Quayle" <Tin### [at] hotmailcom> 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

From: SharkD
Subject: Re: Tiling hexagons
Date: 20 Nov 2008 19:20:01
Message: <web.4925fda31539762d5c688edf0@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> "SharkD" <nomail@nomail> wrote:
> > "Trevor G Quayle" <Tin### [at] hotmailcom> 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

Here's what it looks like:

http://img262.imageshack.us/img262/5598/tileablehexagon3rm8.png

-Mike


Post a reply to this message

From: SharkD
Subject: Re: Tiling hexagons
Date: 20 Nov 2008 19:45:00
Message: <web.492603891539762d5c688edf0@news.povray.org>
Now that I know the aspect ratio, I just have to do some more trig and figure
out the area of the scene to render. What I've actually done is create a
horizontal plane with a checker pattern and rotate the camera so that the
checker pattern appears to cross at 60 and 120 degree angles. This probably
just involves reversing the camera transformations.

-Mike


Post a reply to this message

From: SharkD
Subject: Re: Tiling hexagons
Date: 20 Nov 2008 20:10:00
Message: <web.492609b41539762d5c688edf0@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> Now that I know the aspect ratio, I just have to do some more trig and figure
> out the area of the scene to render. What I've actually done is create a
> horizontal plane with a checker pattern and rotate the camera so that the
> checker pattern appears to cross at 60 and 120 degree angles. This probably
> just involves reversing the camera transformations.
>
> -Mike

Alright! Here's a simple scene that shows everything in action. Simply render at
97x56 pixels or one of the other resolutions that fit the aspect ratio. You'll
notice there's no hexagons. That's because I was aiming for a grid of diamonds,
but with the same angles as hexagons or equilateral triangles.

#include "math.inc"

camera
{
 #local CameraDistance = 10;
 #local ScreenArea = sqrt(2*pow(1,2));
 #local AspectRatio = image_width/image_height;
 orthographic
 location -z*CameraDistance
 direction z*CameraDistance
 right     x*ScreenArea
 up        y*ScreenArea/AspectRatio
 rotate x*asind(tand(30))
 rotate y*45
}

plane
{
 y,0
 texture
 {
  pigment
  {
   checker color rgb 0, color rgb 1
  }
  finish
  {
   ambient 1
  }
 }
 scale 1
}


Post a reply to this message

From: Dan Connelly
Subject: Re: Tiling hexagons
Date: 20 Nov 2008 22:31:09
Message: <49262b7d$1@news.povray.org>
SharkD wrote:

> Alright! Here's a simple scene that shows everything in action.

Ahh!  I understand.  I had thought this had something to do with the hexagon
pattern.....  using image maps to fill each of the three reference hexagons.

This reminds me of the issue of finding orthogonal basis vectors for hexagonal
crystals.  But of course it's the same thing.

Dan


Post a reply to this message

From: SharkD
Subject: Re: Tiling hexagons
Date: 21 Nov 2008 16:35:01
Message: <web.4927288c1539762d649111430@news.povray.org>
Dan Connelly <djc### [at] yahoocom> wrote:
> SharkD wrote:
>
> > Alright! Here's a simple scene that shows everything in action.
>
> Ahh!  I understand.  I had thought this had something to do with the hexagon
pattern.....  using image maps to fill e
ach of the three reference hexagons.
>
> This reminds me of the issue of finding orthogonal basis vectors for hexagonal
crystals.  But of course it's the same
 thing.
>
> Dan

I forgot to implement your tip of using the exact camer aspect ratio of
2*cos(pi/6)/1. Here's the corrected code. Thanks again for your help?

camera
{
 #local CameraDistance = 10;
 #local ScreenArea = sqrt(2*pow(1,2));
 #local AspectRatio = 2*cos(pi/6)/1;
 orthographic
 location -z*CameraDistance
 direction z*CameraDistance
 right     x*ScreenArea
 up        y*ScreenArea/AspectRatio
 rotate x*asind(tand(30))
 rotate y*45
}

plane
{
 y,0
 texture
 {
  pigment
  {
   checker color rgb 0, color rgb 1
  }
  finish
  {
   ambient 1
  }
 }
 scale 1
}


Post a reply to this message

From: Dan Connelly
Subject: Re: Tiling hexagons
Date: 22 Nov 2008 07:38:31
Message: <4927fd47$1@news.povray.org>
SharkD wrote:

>  #local AspectRatio = 2*cos(pi/6)/1;

Not to be picky... okay, being picky....but why do you divide by 1 here?  (even I can
do that in my head :)).

2 cos(pi/6) = sqrt(3), BTW.... (not that one's necessarily better than the other)


Post a reply to this message

From: John VanSickle
Subject: Re: Tiling hexagons
Date: 22 Nov 2008 21:13:14
Message: <4928bc3a@news.povray.org>
SharkD wrote:
> I want to create an image of hexagons that is tilable (such as a Desktop image).
> However, I don't think it's possible to create a rectangular image with the
> correct width/height ratio due to the odd angles. What's the best way to go
> about doing this?

If you look at the way bricks are generally placed in a wall, you can 
see that the top half of an image, if split and switched left/right in 
the bottom half, can make a good hex tiling image.

There are plenty of integer pairs that come very close to the value of 
sqrt(.75), so getting an image with good-looking proportions isn't hard.

Regards,
John


Post a reply to this message

From: SharkD
Subject: Re: Tiling hexagons
Date: 24 Nov 2008 00:05:00
Message: <web.492a35be1539762dccd1a2f80@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> I want to create an image of hexagons that is tilable (such as a Desktop image).
> However, I don't think it's possible to create a rectangular image with the
> correct width/height ratio due to the odd angles. What's the best way to go
> about doing this?
>
> -Mike

I modified my website to make use of the technique:

http://www.geocities.com/mikehorvath.geo/povray.htm

You'll need Firefox (haven't tested Opera) for the full effect, since Geocities
inserts junk before the doctype and forces IE into quirksmode.

-Mike


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.