POV-Ray : Newsgroups : povray.general : Tiling hexagons : Re: Tiling hexagons Server Time
30 Jul 2024 22:17:14 EDT (-0400)
  Re: Tiling hexagons  
From: SharkD
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

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