Flynn52

Test-SinCos

Mar 16th, 2018
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ***************************************************
  2. //           Test-SinCos  (c) 2000 by Flynn          *
  3. // ***************************************************
  4.  
  5. #version 3.7
  6. global_settings { assumed_gamma 2.2 }
  7.  
  8. #include "colors.inc"
  9. #include "textures.inc"
  10.  
  11.  
  12.  camera {
  13.     //location  <-150, 15,-45>
  14.     location  <40, 130, -500>     // <-20, 15,20>
  15.     direction <0, 0,  1>
  16.     up        <0,  1,  0>
  17.     right     <4/3, 0,  0>
  18.     //look_at   <60, 2, 0>
  19.     look_at   <60, 2, 0>
  20.     }
  21.  
  22.  background { color SkyBlue }
  23.  
  24.  light_source {<40, 130, -500> color red 3 green 3 blue 3 }
  25.  
  26.  
  27.  plane
  28.  {
  29.     <0, 15, 0>, -1
  30.     pigment
  31.     {
  32.        checker color Red, color Blue
  33.     }
  34.     translate <0,-60,0>
  35.    
  36.  }
  37.  
  38.  #declare r1=6
  39.  #declare A=0.1
  40.  #declare B=0.25
  41.  #declare rad=2
  42.  
  43.  #declare c_red=0
  44.  #declare c_green=0
  45.  #declare c_blue=0
  46.  
  47.  #declare Count=150
  48.  
  49. union
  50. {
  51.   #while (Count>=0)
  52.     #declare X=Count
  53.     #declare Y=r1*cos(A*Count)*sin(B*Count)
  54.     #declare Z=r1*cos(A*Count)*sin(B*Count)
  55.    
  56.  
  57.     sphere
  58.     {
  59.         <X,Y,Z>, rad
  60.         pigment
  61.         {
  62.             color <c_red,c_green,c_blue>
  63.         }
  64.     }
  65.     /*
  66.     sphere
  67.     {
  68.         <X+20,Y,Z>, rad
  69.         texture
  70.         {
  71.            Yellow_Glass
  72.         }
  73.     }
  74.     sphere
  75.     {
  76.         <X+40,Y,Z>, rad
  77.         texture
  78.         {
  79.            Yellow_Glass
  80.         }
  81.     }
  82.     */
  83.  
  84.     #declare Count=Count-1
  85.    
  86.     #if (c_red < 1)
  87.         #declare c_red = c_red + 0.03
  88.     #else
  89.         #declare c_red = c_red - 0.03
  90.     #end          
  91.     #if (c_green < 1)
  92.         #declare c_green = c_green + 0.03
  93.     #else
  94.         #declare c_green = c_green - 0.03
  95.     #end
  96.     #if (c_blue < 1)
  97.         #declare c_blue = c_blue + 0.03
  98.     #else
  99.         #declare c_blue = c_blue - 0.03
  100.     #end
  101.    
  102.    
  103.   #end
  104.   rotate <-30,22,0>
  105. }
Add Comment
Please, Sign In to add comment