Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!alligator.cis.ohio-state.edu!dirks From: dirks@alligator.cis.ohio-state.edu (william r dirks) Newsgroups: comp.graphics Subject: Re: Pixar's noise function Summary: I fixed a bug Keywords: random numbers, Byte, elephants Message-ID: <43327@tut.cis.ohio-state.edu> Date: 13 Apr 89 20:21:20 GMT References: <2553@ssc-vax.UUCP> <3599@pixar.UUCP> <97699@sun.Eng.Sun.COM> <1592@ccncsu.ColoState.EDU> Sender: news@tut.cis.ohio-state.edu Reply-To: william r dirks Organization: Ohio State University Computer and Information Science Lines: 34 I implemented Jon Buller's noise functions the other night. (Thanks Jon, I've been looking for a decent noise function for a long time.) Anyway, I rendered a polygon situated in the x-y plane with DNoise() added to the normal vectors to make a bumpy-looking surface. But I noticed there were discontinuities in the "bumps." Studying the image, I noticed that where x and y were both positive the bumps were continuous, where x was negative and y was positive there were lines of discontinuity parallel to the y-axis, where x was positive and y was negative the lines were parallel to the x-axis, and where both x and y were negative the two sets of lines intersected to form squares. On a hunch I changed all the trunc()'s in the source to floor()'s. And presto!! Continuous bumps everywhere! Now I can make bumpy surfaces that look just like Perlin's! I traced a bumpy glass last night. I don't know why a glass would be bumpy, but it looks cool as hell! (The difference between trunc() and floor(), of course, is that trunc() rounds toward 0, but floor() always rounds down. So these functions are the same for positive numbers, but different for negative ones.) __________________________________________________________________________ | Name: Bill Dirks | | Address: dirks@baloo.eng.ohio-state.edu | | Bumper Sticker: "STOP ME AND ASK ME ABOUT MY RAY-TRACER" | | Quote: "Survival and preservation must cancel out programming." | | -- Star Trek, "What Are Little Girls Made Of?" | | Disclaimer: #include | `=========================================================================='