POV-Ray : Newsgroups : povray.text.scene-files : tikset_03.pov (glowy blue things) Server Time
3 May 2024 12:10:55 EDT (-0400)
  tikset_03.pov (glowy blue things) (Message 1 to 1 of 1)  
From: povray
Subject: tikset_03.pov (glowy blue things)
Date: 20 Oct 2006 17:27:33
Message: <e37.4536a6a9.c72f9@localhost>
Saw a cool render here some time ago with these sort of g-shaped
boxy glowy things in all colors.  Looked cool.  Forget who it was:
sorry.  This is an attempt to get the same effect from scratch,
except in blue.  Coded from scratch in .pov by me.

#version 3.5;
#declare use_rad = true;
#declare rseed = seed(20724119);


global_settings {
  //assumed_gamma 2.2
  assumed_gamma 1.6
  noise_generator 1
  #if (use_rad = true)
    radiosity {
      /* uses v3.5 radiousity syntax */
      always_sample off // You can force POV-Ray to only use the data from
                        // the pretrace step and not gather any new samples
                        // during the final radiosity pass. This may reduce
                        // splotchiness.
                        // It can also be usefull when reusing previously
                        // saved radiosity data.
      brightness 1
      count 144  // number of rays that are sent out whenever a new radiosity
                 // value has to be calculated
      error_bound 0.3   // lower than 0.1 is not recommended
      low_error_factor 0.4 // work harder during pretrace
      max_sample 1.0    // scale level of overly bright samples to not exceed 
      recursion_limit 3
      normal on         // whether or not radiousity accounts for normals
      pretrace_start 0.08
      pretrace_end 0.02
    }
  #end
}


#macro rnd(n)
  #local dummy = rand(rseed);
  #local rr = int(n * rand(rseed));
  #local dummy = rand(rseed);
  rr
#end


#macro rrand(lo, hi)
  #local rlo = min(lo, hi);
  #local rhi = max(lo, hi);
  #local dummy = rand(rseed);
  #local rr = rlo + (rand(rseed) * (rhi - rlo));
  #local dummy = rand(rseed);
  rr
#end


camera {
  location 0
  direction <0, 0, 1>
  right <image_width / image_height, 0, 0>
  up <0, 1, 0>
  rotate x*90
  translate <0, 8, 0>
}


plane { // floor
  <0, 1, 0>, 0
  pigment { color rgb 1 }
  finish { ambient 0 diffuse 1 }
  normal { agate bump_size -0.2 rotate <4, 5, 6> translate <6, -7.5, 31> }
}


#declare l_th = 0.05;
#declare l_ha = 0.5 - l_th;
#declare l_qu = 0.25 - l_th;


#declare g_frame = union {
  // bottom panal
  cylinder { <-l_ha, l_th, -l_qu>, <-l_ha, l_th, l_qu>, l_th }
  cylinder { < l_ha, l_th, -l_qu>, < l_ha, l_th, l_qu>, l_th }
  cylinder { <-l_ha, l_th, -l_qu>, < l_ha, l_th, -l_qu>, l_th }
  cylinder { <-l_ha, l_th,  l_qu>, < l_ha, l_th,  l_qu>, l_th }
  sphere { <-l_ha, l_th, -l_qu>, l_th }
  sphere { < l_ha, l_th, -l_qu>, l_th }
  sphere { <-l_ha, l_th,  l_qu>, l_th }
  sphere { < l_ha, l_th,  l_qu>, l_th }
  // left lower uprights
  cylinder { <-l_ha, 0.9 - l_th, -l_qu>, <-l_ha, l_th, -l_qu>, l_th }
  cylinder { <-l_ha, 0.9 - l_th,  l_qu>, <-l_ha, l_th,  l_qu>, l_th }
  sphere { <-l_ha, 0.9 - l_th,  l_qu>,  l_th }
  sphere { <-l_ha, 0.9 - l_th, -l_qu>,  l_th }

  // lower left upsurface
  cylinder { <-l_ha, 0.9 - l_th, -l_qu>, <0, 0.9 - l_th, -l_qu>, l_th }
  sphere { <0, 0.9 - l_th, -l_qu>, l_th }
  cylinder { <-l_ha, 0.9 - l_th,  l_qu>, <0, 0.9 - l_th,  l_qu>, l_th }
  sphere { <0, 0.9 - l_th,  l_qu>, l_th }
  cylinder { <-l_ha, 0.9 - l_th,  l_qu>, <-l_ha, 0.9 - l_th, -l_qu>, l_th }
  cylinder { <0, 0.9 - l_th,  l_qu>, <0, 0.9 - l_th, -l_qu>, l_th }

  // right uprights - all the way up
  cylinder { <l_ha, l_th, -l_qu>, <l_ha, 2 - l_th, -l_qu>, l_th }
  cylinder { <l_ha, l_th,  l_qu>, <l_ha, 2 - l_th,  l_qu>, l_th }
  sphere { <l_ha, 2 - l_th, -l_qu>, l_th }
  sphere { <l_ha, 2 - l_th,  l_qu>, l_th }

  // inner uprights
  cylinder { <0, 0.9 - l_th, -l_qu>, <0, 1.5, -l_qu>, l_th }
  cylinder { <0, 0.9 - l_th,  l_qu>, <0, 1.5,  l_qu>, l_th }
  sphere { <0, 1.5, -l_qu>, l_th }
  sphere { <0, 1.5,  l_qu>, l_th }

  // left upper bump - bottom surface
  cylinder { <0, 1.5, -l_qu>, <0, 1.5,  l_qu>, l_th }
  cylinder { <-l_qu, 1.5, -l_qu>, <0, 1.5, -l_qu>, l_th }
  cylinder { <-l_qu, 1.5,  l_qu>, <0, 1.5,  l_qu>, l_th }
  cylinder { <-l_qu, 1.5, -l_qu>, <-l_qu, 1.5,  l_qu>, l_th }
  sphere { <-l_qu, 1.5, -l_qu>, l_th }
  sphere { <-l_qu, 1.5,  l_qu>, l_th }

  // left upper uprights
  cylinder { <-l_qu, 1.5, -l_qu>, <-l_qu, 2 - l_th, -l_qu>, l_th }
  cylinder { <-l_qu, 1.5,  l_qu>, <-l_qu, 2 - l_th,  l_qu>, l_th }
  sphere { <-l_qu, 2 - l_th,  -l_qu>, l_th }
  sphere { <-l_qu, 2 - l_th,  l_qu>, l_th }

  // upper face
  cylinder { <-l_qu, 2 - l_th,  -l_qu>, <-l_qu, 2 - l_th,  l_qu>, l_th }
  cylinder { <l_ha, 2 - l_th,  -l_qu>, <l_ha, 2 - l_th,  l_qu>, l_th }
  cylinder { <-l_qu, 2 - l_th,  -l_qu>, <l_ha, 2 - l_th, -l_qu>, l_th }
  cylinder { <-l_qu, 2 - l_th,   l_qu>, <l_ha, 2 - l_th,  l_qu>, l_th }
}
// this .pov file by Peter C. Capasso
// released in the public domain: share and enjoy  ;)
#declare g_solid = union {
  prism {
    linear_sweep
    linear_spline
    -0.25,
    0.25,
    9,
    < l_ha, l_th>,
    <-l_ha, l_th>,
    <-l_ha, 0.9 - l_th>,
    <0, 0.9 - l_th>,
    <0, 1.5>,
    <-l_qu, 1.5>,
    <-l_qu, 2 - l_th>,
    < l_ha, 2 - l_th>,
    < l_ha, l_th>
  }
  prism {
    linear_sweep
    linear_spline
    -l_qu,
    l_qu,
    15,

    <l_ha, 0>,
    <-l_ha, 0>,
    <-0.5, l_th>,
    <-0.5, 0.9 - l_th>,
    <-l_ha, 0.9>,
    <-l_th, 0.9>,
    <-l_th, 1.5 - l_th>,
    <-l_qu, 1.5 - l_th>,
    <-0.25, 1.5>,
    <-0.25, 2 - l_th>,
    <-l_qu, 2>,
    <l_ha, 2>,
    <0.5, 2 - l_th>,
    <0.5, 0 + l_th>,
    <l_ha, 0>
  }
  rotate x*-90
}


#macro random_limited_color()
  #local bbase_color = <0, 0.2 + 0.6 * rand(rseed), 1>;
  #local sat = rand(rseed);
  #local sat = sqrt(sat);
  #local rrc = (bbase_color * sat) + (1 - sat);
  rrc
#end


#macro rnd_color()
  #local rr = random_limited_color();
  rr
#end


#macro place_dinkus(put_here, rrad)
  #local c1 = rnd_color();
  #local c2 = rnd_color();
  #if (rand(rseed) > 0.8)
    #local glow_f = 1;
  #else
    #local glow_f = 0;
  #end
  union {
    object {
      g_frame
      pigment { color rgb c1 }
      finish { ambient glow_f diffuse 1 - glow_f }
    }
    object {
      g_solid
      pigment { color rgb c2 }
      finish { ambient 1 - glow_f diffuse glow_f }
    }
    rotate y*rnd(360)
    scale rrad
    scale 1.7
    translate put_here
  }
#end


#macro place_something(put_here, RAD)
  #local rr = rnd(13);
  #switch (rr)
    #case (0)
    #case (1)
    #case (2)
    #case (3)
      sphere {
        <0, 1, 0>, 1
        scale RAD
        translate put_here
        pigment { color rgb 1 }
        finish { ambient 0 diffuse 1 }
      }
      #break
    #case (4)
    #case (5)
      sphere {
        <0, 1, 0>, 1
        scale RAD
        translate put_here
        pigment { color rgb 1 }
        finish { ambient 0 diffuse 0 reflection 1 }
      }
      #break
    #else
      place_dinkus(tt[cc], ttr[cc])
  #end // wnd switch
#end


#declare num_things = 570;
#declare tt = array[num_things];  /* center */
#declare ttr = array[num_things]; /* radius */
#declare tt[0] = <0, 0, 0>;
#declare ttr[0] = 0;
#declare cc = 0;
#while (cc < num_things)
  #declare ttr[cc] = rrand(0.125, 0.5);
  #declare tt[cc] = <rrand(-9, 9), 0 rrand(-7, 7)>;
  #declare bump_yes = false;
  #declare ck = 0;
  #while (ck < cc)
    #declare temp1 = tt[cc] - tt[ck];
    #declare temp2 = vlength(temp1);
    #declare temp3 = (ttr[cc] + ttr[ck]);
    #if (temp2 < temp3)
      #declare ck = cc;
      #declare bump_yes = true;
    #end
    #declare ck = ck + 1;
  #end
  #if (bump_yes = false)
    place_something(tt[cc], ttr[cc])
    #debug concat(str(cc, 0, 0), "\n")
    #declare cc = cc + 1;
  #end
#end


#if (use_rad = false)
  light_source {
    <-4000, 3000, -3000>
    color rgb <0.55, 0.5, 0.45>
  }
  light_source {
    <3000, 2001, -4000>
    color rgb <0.45, 0.5, 0.55>
  }
#end


/* actual end of this file */


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.