POV-Ray : Newsgroups : povray.newusers : TRON Game Grid... : Re: TRON Game Grid... Server Time
29 Jul 2024 06:13:20 EDT (-0400)
  Re: TRON Game Grid...  
From: Carl
Date: 8 Jul 2006 17:10:01
Message: <web.44b01da6c60ff13047c7ed100@news.povray.org>
Sebastian <van### [at] gmxde> wrote:
> For a nice grid you can layer two textures of which one holds
> the x lines and one the z lines.

I guess I should have been more specific.  I can make a nice grid.  Here is
what I'm using at the moment.

  #macro GameGrid(x_length, z_length, block_size)
    // x_length and z_length are the dimentions of the game grid.
    // block_size is the length of an individual block on the game grid.
    // Should be a factor of both x_length and z_length.

    #local x_grids = x_length/block_size;
    #local z_grids = z_length/block_size;

    #local Foo = function {select (
      min(x*(x_grids-x),z*(z_grids-z)),
      select (
        min((x+0.02)*(x_grids+0.02-x),(z+0.02)*(z_grids+0.02-z)),
        0.5,
        0.02-min((x+0.02),(x_grids+0.02-x),(z+0.02),(z_grids+0.02-z))
      ),

min(abs(x)-int(abs(x)),abs(z)-int(abs(z)),1-(abs(x)-int(abs(x))),1-(abs(z)-int(abs(z))))
    )};

    plane {y, 0
      pigment {
        function { Foo(x, y, z) }
        color_map {
          [0 color White]
          [0.01 color White]
          [0.02 rgb <0,0.05,0>]
          [0.98 rgb <0,0.05,0>]
          [0.99 color White]
          [1 color White]
        }
      scale block_size
      }
      finish {
        ambient .1
        diffuse .5
        specular 1
        phong 1
      }
    }
  #end

However I'd like a TRON grid.  In TRON the width of the grid lines doesn't
narrow with distance from the camera quite as it should.  There is some
narrowing going on but note in the gif I posted above that the narrow white
lines soon fill the entire plane in the distance.  Its this effect that has
now been copied in Realsoft 3D and I'm curious if POV-Ray can do it as well.

Thanks,
Carl


Post a reply to this message

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