Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!ucsd!nprdc!malloy From: malloy@nprdc.arpa (Sean Malloy) Newsgroups: comp.graphics Subject: Re: Pixar's noise function Keywords: random numbers, Byte, elephants Message-ID: <1771@skinner.nprdc.arpa> Date: 15 Apr 89 21:58:13 GMT References: <2553@ssc-vax.UUCP> <3599@pixar.UUCP> <97699@sun.Eng.Sun.COM> <1592@ccncsu.ColoState.EDU> <43327@tut.cis.ohio-state.edu> <1648@ccncsu.ColoState.EDU> Reply-To: malloy@nprdc.arpa (Sean Malloy) Organization: Navy Personnel R&D Center, San Diego Lines: 27 In article <1648@ccncsu.ColoState.EDU> bullerj@handel.colostate.edu.UUCP (Jon Buller) writes: |In article <43327@tut.cis.ohio-state.edu> william r dirks writes: |>On a hunch I changed all the trunc()'s in the source to floor()'s. |> |>And presto!! Continuous bumps everywhere! | | I wish I could do that, my compiler doesn't have a built in Floor, |and I haven't had the time to hack one up from the Mac toolbox and SANE |(IEEE math pkg) calls, oh well, I'll have to settle for only using |X, Y, and Z >= 0.0 If I understand the problem correctly, writing a floor() function is extremely simple: int floor(x) double x; { if (x >= 0.0) return(trunc(x)); else return(trunc(x)+1); } Sean Malloy | "The proton absorbs a photon Navy Personnel Research & Development Center | and emits two morons, a San Diego, CA 92152-6800 | lepton, a boson, and a malloy@nprdc.navy.mil | boson's mate. Why did I ever | take high-energy physics?"