POV-Ray : Newsgroups : povray.advanced-users : Need Help with Noise Macro! : Re: Need Help with Noise Macro! Server Time
29 Jul 2024 20:21:23 EDT (-0400)
  Re: Need Help with Noise Macro!  
From: Vahur Krouverk
Date: 9 Jan 2001 13:42:30
Message: <3A5B5C32.9277E619@aetec.ee>
Lonnie Ezell wrote:
> 
> I've got what I believe should be a working POV macro for Perlin noise (2D
> only, currently). After fixing a number of typographical errors, it now
> crashes whenever I try to use it.
> 
> I was wondering if someone would be willing to look at the code for me.
> 
> If you're up to it, either post here, or write me at kil### [at] homecom.
> 
> Thanks a ton,
> Lonnie

Well, I got it parsing after some modifications, but it doesn't seem to
produce correct output. I've no time to examine it more closely, but
seems like macro ED_NOISE_Rand_2D doesn't produce what it should be (see
below).
I made following changes in 8D_noise.inc:
line 82:
   ( ( (rand(ED_NOISE_RandArray[octave])*m_x) + (
(rand(ED_NOISE_RandArray[octave]) * m_y) ) ) / 2.0 )   
(you had x and y instead of m_x and m_y, so returned value was vector
instead of float and parser chocked on it. But seems like you have
semantical problem there as well, as you multiply random value with
input value (evaluation point) and thus returned value is not between 0
and 1, but grows with x or y.  Additionally, code in Elias homepage
assumes, that generated value is between -1 and 1, so if you add
different octaves together, then some of them actually decrease total
value. I'd suggest to work with this generator and get it working
correctly, everything else will come afterwards...

line 98: "sides" is keyword in MegaPov, so if you use MegaPov or its
derivate, then change this name.
Macro ED_NOISE_Noise_2D should return ED_total (line 153) instead of
total.
additionally, lines 146 and 147 miss the terminating semicolon.

I don't understand though, why your POVRay crashed on it. Which version
do you use?

HTH,
Vahur


Post a reply to this message

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