Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!ames!ncar!boulder!ccncsu!handel.colostate.edu!bullerj From: bullerj@handel.colostate.edu (Jon Buller) Newsgroups: comp.graphics Subject: Re: Pixar's noise function Summary: my noise, better described (I hope) Keywords: random numbers, Byte, elephants Message-ID: <1592@ccncsu.ColoState.EDU> Date: 6 Apr 89 19:50:40 GMT References: <2553@ssc-vax.UUCP> <3599@pixar.UUCP> <97699@sun.Eng.Sun.COM> Sender: news@ccncsu.ColoState.EDU Reply-To: bullerj@handel.colostate.edu.UUCP (Jon Buller) Organization: Colorado State University, Ft. Collins CO 80523 Lines: 54 In article <97699@sun.Eng.Sun.COM> jamesa@arabian.Sun.COM (James D. Allen) writes: >In article <3599@pixar.UUCP>, aaa@pixar.UUCP (Tony Apodaca) writes: >> In article <2553@ssc-vax.UUCP> coy@ssc-vax.UUCP (Stephen B Coy) writes: >> > ...My question: Does anyone out there know what this >> >noise function really is? >> >> ... Conceptually, noise() >> is a "stochastic three-dimensional function which is statistically >> invariant under rotation and translation and has a narrow bandpass >> limit in frequency" (paraphrased from [Perlin1985]). This means that >> you put three-space points in, and you get values back which are basically >> random. But if you put other nearby points in, you get values that are >> very similar. The differences are still random, but the maximum rate of >> change is controlled so that you can avoid aliasing. If you put a set >> of points in from a different region of space, you will get values out >> which have "the same amount" of randomness. > > Anyone willing to post a detailed description of such an > algorithm? (Jon Buller posted one, but I couldn't figure it out: > what is `Pts'?) Sorry about not really describing my program to anyone, I know what it does, and I never expected anyone else to see it (isn't it obvious) :-) What it does is: pass a location in space, and an array of random numbers (this is 'Pts'). I fill the array with 0.0 .. 1.0 but any values or range will work. (I have other textures which color based on distance to the nearest point of a random set, hence the name, It has 4 values per entry at times.) Step 1: change the location to a group of points to interpolate. This is where xa,xb,xc,...zc come in, any location with the same coords (when trunc'ed) will produce the same xa...zc values, making the same values for the interpolation at the end. These xa..zc are then hashed in to the 'Pts' array to produce p000...P222, these 27 random numbers are then interpolated with a Quadratic 3d B-Spline (the long ugly formula at the end). The variables based on xf,yf, and zf (I belive they are x0..z2) are the B-Spline basis functions (notice to get DNoise, just take the (partial) deriveatives(sp?) of the basis functions and re-evaluate the spline). Step 2: now you have a value that is always smaller than the largest random number in 'Pts' (equal to in the odd case that major bunches of the numbers are also the maximum in the range). By the same argument, all numbers returned are larger than the smallest number in the array. (this can be handy if you don't want to have to clip your values to some limit.) I hope this explains the use of the routine better. Sorry I didn't realize that earlier. If you have any other questions about it, mail them to me, and I'll do my best to explain it. Jon ------------------------------------------------------------------------------- Jon Buller FROM fortune IMPORT quote; ..!ccncsu!handel!bullerj FROM lawyers IMPORT disclaimer;