home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / sci / fractals / 358 < prev    next >
Encoding:
Text File  |  1992-11-19  |  2.7 KB  |  53 lines

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