POV-Ray : Newsgroups : povray.binaries.images : concept to visualization II Server Time
1 Oct 2024 13:18:40 EDT (-0400)
  concept to visualization II (Message 1 to 8 of 8)  
From: Matt Giwer
Subject: concept to visualization II
Date: 21 Aug 2000 00:10:17
Message: <39A0AC2E.E382972B@ij.net>
I took the advice and instead of using a mesh created a .tga
file. The attached file shows the format and how to do it.
(Pardon my french in the code.) The image is for 2000 iterations
before creating the image file for rendering which is the third
attachment. And file 3 brings it all together. 

	And yes, this approach is much less strain on the system. But
even this way under linux it crashes graphics terminals so I have
to run in under a text terminal. The procedure output creates a
file to include in a mesh object if you want to compare the
strain on your machine. The procedure ouput_tga creates the
uncompressed targa file to use in array3.pov. 

	If you are interested in order out of randomness, the procedure
where the rules are defined is average_array. Implemented is the
simplest average, the new value is the eight contiguous points
and its old self divide by nine points. 

X X X
X O X  sum/9 = New value in the Old position
X X X 

	If you know any programming at all this should be easy to change
to your interests. Don't forget to post interesting things.
Remember not to go negative or greater than 257. 

	Yes, I know, p*** poor documentation on the fly. All questions
will be answered. 

==

Notes 

	Search www.google.com for free pascal and download it for most
any platform and OS combination. It is a clone of Turbo Pascal
7.0 (tpx) with extensions (units) to let you do socket, cgi, all
the internet programming stuff if you wish. 

	3 should be easily convertable into a batch file possibly
without any change other than renaming it 3.bat and it is nothing
but a a convenience rather than a complex script. Of course this
will require the DOS version of povray. 

	This runs on Redhat linux 6.1b PII 333MHz 128M. 

-- 
How many Palestinians will we murder because
Hillary needs the jewish vote? 
     -- The Iron Webmaster, 20


Post a reply to this message


Attachments:
Download 'array3-2000.jpg' (71 KB) Download 'us-ascii' (5 KB) Download 'us-ascii' (2 KB) Download 'us-ascii' (1 KB)

Preview of image 'array3-2000.jpg'
array3-2000.jpg

From: Christoph Hormann
Subject: Re: concept to visualization II
Date: 21 Aug 2000 04:14:02
Message: <39A0E4EC.EA4F8595@schunter.etc.tu-bs.de>
Matt Giwer wrote:
> 
[...]
> 
>         If you know any programming at all this should be easy to change
> to your interests. Don't forget to post interesting things.
> Remember not to go negative or greater than 257.

you mean not greater than 255 ($ff).

> 
>         Yes, I know, p*** poor documentation on the fly. All questions
> will be answered.
> 

Your tga-writer seems quite ugly :-) i mostly use the following record and write
it via TFileStream (Delphi):

   T_TGA_header = packed record
    ID_size: Byte;            { ID-Field                   }
    Palette: Byte;            { 1= Palette exists          }
    Typ: Byte;                { Type (Mono, Color, compr.) }
    Pal_index: Word;         
    Pal_size: Word;          
    Pal_entry_size: Byte;    
    Lx    : Word;            
    Ly    : Word;            
    cX    : Word;             { Width                      }
    cY    : Word;             { Height                     }
    Bppix : Byte;             { Bits per Pixel - 1, 8, 24  }
    Image_des: Byte;          { Image Descriptor Flag      }
   end;

Don't know where i originally got this from but it works just fine.  

I don't know about Free Pascal and writing of recods, in speed pascal i used
blockwrite. 

Thinking about your program I wonder what is the purpose of all this, just
visualizing randomness ? 

BTW, you probably can do the same with HF-Lab, just generate a random matrix and
apply a smooth filter... wait a moment, since Chris Huff developed a noise
pigment you can even do this in good old POV.

Christoph 

--
Christoph Hormann <chr### [at] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Simen Kvaal
Subject: Re: concept to visualization II
Date: 21 Aug 2000 17:36:23
Message: <39a1a0d7@news.povray.org>
What's up with the order out of chaos-thing? Your progam seems to run a
simple average filter (aka blur) on a two-dimensional array consisting of
random numbers. Doing tihis a couble of times makes the image converge to
some result. (There is finite presicion within the figures used, so
eventually changes won't be noticeable.) But what I don't get is what it has
to do with chaos theory and/or complexity?

Regards,
Simen.



"Matt Giwer" <jul### [at] ijnet> wrote in message
news:39A0AC2E.E382972B@ij.net...
>
> If you are interested in order out of randomness, the procedure
> where the rules are defined is average_array. Implemented is the
> simplest average, the new value is the eight contiguous points
> and its old self divide by nine points.
>
> X X X
> X O X  sum/9 = New value in the Old position
> X X X
>
> If you know any programming at all this should be easy to change
> to your interests. Don't forget to post interesting things.
> Remember not to go negative or greater than 257.
>


Post a reply to this message

From: Matt Giwer
Subject: Re: concept to visualization II
Date: 21 Aug 2000 18:07:16
Message: <39A1A8AE.72EB23EC@ij.net>
Christoph Hormann wrote:
> 
> Matt Giwer wrote:
> >
> [...]
> >
> >         If you know any programming at all this should be easy to change
> > to your interests. Don't forget to post interesting things.
> > Remember not to go negative or greater than 257.
> 
> you mean not greater than 255 ($ff).

	No. The array is 0-257,0-256. Just an artifact of how I created
it. The operations are all 1-256,1-256 elements. The compiler
could care less. The warning is that Free Pascal will terminate
with an out of range error message. Some language will take
whatever they find in the calculated memory space. 

-- 
For recycling, should trash be separated by color,
religion, sexual orientation or ethnic origin?
      -- The Iron Webmaster, 25


Post a reply to this message

From: Matt Giwer
Subject: Re: concept to visualization II
Date: 21 Aug 2000 18:19:26
Message: <39A1AB88.E1B60971@ij.net>
Simen Kvaal wrote:
> 
> What's up with the order out of chaos-thing? Your progam seems to run a
> simple average filter (aka blur) on a two-dimensional array consisting of
> random numbers. Doing tihis a couble of times makes the image converge to
> some result. (There is finite presicion within the figures used, so
> eventually changes won't be noticeable.) But what I don't get is what it has
> to do with chaos theory and/or complexity?

	To the last first. Just something I want to play with. I posted
it here as in the past there has been some interest using POV for
modeling equations. 

	As to converging to the same result, it doesn't appear to do
that by the images I have run. That is why my next step is an
animation. 500, 1000, 2000, and 5000 interations are all
different but all look the same, sort of like getting closer to a
fractal. Note noise is added to each averaging result. 

	OTOH: there may be a bug in the random number generator. :( But
then it is test for generators. :) 

	I'll be playing with more interesting things than averaging
after I get some experience with it. 

-- 
"Dissecting the Holocaust" by Germar Rudolph
Banned and burned in Germany. Read what the
German government does not want you to read.
	-- The Iron Webmaster, 45


Post a reply to this message

From: Christoph Hormann
Subject: Re: concept to visualization II
Date: 21 Aug 2000 18:21:58
Message: <39A1ABAF.BA67ADE9@schunter.etc.tu-bs.de>
Matt Giwer wrote:
> 
> >
> > you mean not greater than 255 ($ff).
> 
>         No. The array is 0-257,0-256. Just an artifact of how I created
> it. The operations are all 1-256,1-256 elements. The compiler
> could care less. The warning is that Free Pascal will terminate
> with an out of range error message. Some language will take
> whatever they find in the calculated memory space.
> 

I thought you meant the values in the grid, not the positions, but with
smoothing filter you never exceed the value range anyway...

Christoph

--
Christoph Hormann <chr### [at] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Matt Giwer
Subject: Re: concept to visualization II
Date: 21 Aug 2000 20:45:28
Message: <39A1CDC4.5D1244D8@ij.net>
Christoph Hormann wrote:
> 
> Matt Giwer wrote:
> >
> > >
> > > you mean not greater than 255 ($ff).
> >
> >         No. The array is 0-257,0-256. Just an artifact of how I created
> > it. The operations are all 1-256,1-256 elements. The compiler
> > could care less. The warning is that Free Pascal will terminate
> > with an out of range error message. Some language will take
> > whatever they find in the calculated memory space.
> >
> 
> I thought you meant the values in the grid, not the positions, but with
> smoothing filter you never exceed the value range anyway...

	In this case the variables are set as integer not byte. 

-- 
500,000 Iraqi children dead from 10 years 
of sanctions. Albright says it is worth it.
	-- The Iron Webmaster, 42


Post a reply to this message

From: Chris Huff
Subject: Re: concept to visualization II
Date: 21 Aug 2000 22:20:08
Message: <chrishuff-EAF50C.21212921082000@news.povray.org>
In article <39A0E4EC.EA4F8595@schunter.etc.tu-bs.de>, 
chr### [at] gmxde wrote:

> BTW, you probably can do the same with HF-Lab, just generate a random 
> matrix and apply a smooth filter... wait a moment, since Chris Huff 
> developed a noise pigment you can even do this in good old POV.

You could probably do it by alternating the add and divide post_process 
filters using the noise pigment(to do an average of the image with a 
random noise) and the blur filter(the convolution matrix). The resulting 
image could be used in a height field. Something like this:

#declare Iterations = 2;

// make the only thing in the scene a white background
#background {color rgb 1}

global_settings {
    post_process {
        #declare K=0;
        #while(K < Iterations)
            add {noise_pigment {1, rgb 0, rgb 1}}
            divide {rgb 2}
            convolution {3, 3, 8, 0
                < 1, 1, 1,
                  1, 0, 1,
                  1, 1, 1 >
            }
            #declare K=K+1;
        #end
    }
}

A large number of iterations might take a while to compute, though. It 
might be better to make a post_process filter which does the whole thing.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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