POV-Ray : Newsgroups : povray.binaries.images : Life : Re: Life Server Time
7 Nov 2024 09:25:34 EST (-0500)
  Re: Life  
From: Jaap
Date: 5 Sep 2004 12:40:00
Message: <web.413b406657340d83a8399d8d0@news.povray.org>
SeeSchloss <adr### [at] seeschlossorg> wrote:
> Hi,
>
> I started POVing again, and since I'm in a cellular automata period, I
> implemented Conway's Game of Life in POVRay's preprocessing language,
> which gives a kind of history of the 2D world :)
>
> Everything works fine, the only problem is that I don't want to define
> the initial state of the world in the script. Imagine the quantities of
> lines like :
> #declare world[5][5] = 1;
> #declare world[5][6] = 1;
> ... etc :/
> So, for now I initialise it randomly (the attached picture is with the
> seed 1789 iirc).
>
> Do you know if I could for example read the pixel values of a monochrome
> picture which would describe the initial state of the world ? A nice
> thing would be to have access to a picture like if it was an array

From: Shay
Subject: Re: Q: blurring bump map image in pov ?
Date: 29 Jul 2004 21:31:16
Message: <41096ca4$1@news.povray.org>

Can be done directly, if very slowly in inside POV.
To get direct access to the pixel data of your map, you can use (untested):

#local Pix = function {
   pattern {
     image_pattern { png "bump.png" }
   }
}

image is mapped in function from x=0 y=0 to x=1 y=1, so you would get
pixel <50,100> with
#local Value = Pix ( 50.5/mapwidth , 100.5/mapheight, 0 );

(re-posted by jaap)


Post a reply to this message

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