home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: sci.fractals
- Path: sparky!uunet!elroy.jpl.nasa.gov!news.claremont.edu!jarthur.claremont.edu!omitchel
- From: omitchel@jarthur.claremont.edu (Ocie Mitchell)
- Subject: Re: Help with making the PLASMA image in C
- Message-ID: <1992Nov19.193421.362@muddcs.claremont.edu>
- Keywords: How to calculate the colours ?
- Sender: news@muddcs.claremont.edu (The News System)
- Organization: Harvey Mudd College, Claremont, CA 91711
- References: <DNORT.1.722078665@gribb.hsr.no>
- Date: Thu, 19 Nov 1992 19:34:21 GMT
- Lines: 40
-
- In article <DNORT.1.722078665@gribb.hsr.no> DNORT@gribb.hsr.no (Johansen, Trond Robert 6-96) writes:
- >I am new in fractals, but I am trying to learn about it by making my own
- >pictures. I am making a recursive function that is suppost to draw the
- >plasma picture. The functions get a rectangle and divides this rectangel
- >into four "simmular" rectangels inside the first, and so on. My problem now
- >is how to calculate the colours. I know that the colours (of the four
- >corners) depends uppon a random value, and the "mother" rectangle, but HOW
- >does it depend? I also know that when the rectangle is big (at the start of
- >recursion), then the colour depends more of the random than of the colours
- >of the "mother" rectangle.
- >
- [code deleted]
- >I dont know if this is the kind of questions that peopel ask here, but
- >anyway I will be greatfull for all the help I gets.
- >
- >Trond Robert Johansen
- >DNORT@GRIBB.HSR.NO (Internett)
-
- I think what you want to do is pick 4 random colors for the corners and then
- color the midpoints of the rectangle with a color that is the average of the
- colors at its endpoints +/- a random factor that has a magnitude proportional
- to the length of the rectangle's side. so if you started with the colors
- (R,G,B)--------(r,g,b) you would insert a color
- ^here
- and its value would be ((R+r)/2+z*d,(G+g)/2+z*d,(B+b)/2+z*d)
- where d is the distance from the first to second pixel and z is a random #
- in the range -v<z<v. By drawing pictures with different values of v you can
- get smooth (v~0) or rough (v~2) pictures.
- Let me know how this works out, I don't have the resources to program for
- 255 color graphics (or even 3 colors)
- Ocie
-
- ----------------------------------------------+-------------------------------
- ``What do you think sirs?'' -Joel (mst3k) | .sig lite- all .sig no guilt
- ----------------------------------------------+-------------------------------
- __ _ _ _ | Ocie Mitchell
- / ') ' ) ) ) _/_ / /) /) | omitchel@jarthur.claremont.edu
- / / _. o _ / / / o / _. /_ _ // // | Q:is that your real name?
- (__/ (__(_(<_ / ' (_(_(__(__/ /_(<_(/_(/_ | A:yes, it is my real name.
- ----------------------------------------------+-------------------------------
-