POV-Ray : Newsgroups : povray.text.scene-files : ds_round.pov Server Time
1 Nov 2024 03:16:14 EDT (-0400)
  ds_round.pov (Message 1 to 1 of 1)  
From: nospam
Subject: ds_round.pov
Date: 19 Sep 2001 19:09:53
Message: <3ba92532.2721262@localhost>
This is source for the image on the povray binaries images group.
Yet another of my sad attempts at hull-plate / greebles, this
time plated around a sphere.

Pete

-- 
global_settings {
  assumed_gamma 1.5
  number_of_waves 9
  max_trace_level 6
}


#declare rseed = seed(04137329);
#declare ntsc = false;
#declare b_color = 0;  /* background color */


camera {
  location <0, 0, 0>
  direction <0, 0, 1.5>
  up <0, 1, 0>
  #if (ntsc = true)
    right <(640 / 400) * (10/11), 0, 0>
  #else
    right <(640 / 480), 0, 0>
  #end
  translate <0, 0, -20>
}


#macro rnd_rotate()
  rotate <360 * rand(rseed), 360 * rand(rseed), 360 * rand(rseed)>
#end


#macro rnd_translate()
  translate <
    4 - 8 * rand(rseed),
    4 - 8 * rand(rseed),
    4 - 8 * rand(rseed)
  >
#end


#macro perturb()
  rnd_translate()
  rnd_rotate()
#end


sky_sphere {
  pigment {
    granite
    scale 0.01
    perturb()
    color_map {
      [ 0.88 color rgb 0 ]
      [ 0.88 color rgb 1 ]
    }
  }
}


#macro do_box(c1, c2) // same parameter format as for a box object
  // back wall
  triangle { c1, <c2.x, c1.y, c1.z>, <c2.x, c2.y, c1.z> }
  triangle { c1, <c2.x, c2.y, c1.z>, <c1.x, c2.y, c1.z> }
  // left wall
  triangle { c1, <c1.x, c1.y, c2.z>, <c1.x, c2.y, c2.z> }
  triangle { c1, <c1.x, c2.y, c2.z>, <c1.x, c2.y, c1.z> }
  // right wall
  triangle { <c2.x, c1.y, c2.z>, <c2.x, c1.y, c1.z>, c2 }
  triangle { <c2.x, c1.y, c1.z>, c2, <c2.x, c2.y, c1.z> }
  // bottom
  triangle { <c1.x, c2.y, c2.z>, <c1.x, c2.y, c1.z>, <c2.x, c2.y,
c1.z> }
  triangle { <c1.x, c2.y, c2.z>, <c2.x, c2.y, c1.z>, c2 }
  // top
  triangle { <c1.x, c1.y, c2.z>, c1, <c2.x, c1.y, c1.z> }
  triangle { <c1.x, c1.y, c2.z>, <c2.x, c1.y, c1.z>, <c2.x, c1.y,
c2.z> }
  // front
  triangle { <c1.x, c1.y, c2.z>, <c2.x, c1.y, c2.z>, c2 }
  triangle { <c1.x, c1.y, c2.z>, c2, <c1.x, c2.y, c2.z> }
#end


#declare plate_01 = mesh {
  do_box(<-0.1, -0.5, -0.5>, <0, 0.5, 0.5>) // main part
  do_box(<-0.1, -0.55, -0.3>, <0, -0.5, 0.2>)
  do_box(<0, -0.4, -0.2>, <0.05, -0.1, -0.4>)
  do_box(<0,  0.0, -0.2>, <0.05, 0.4, -0.4>)
  do_box(<0, -0.4,  0.2>, <0.05, 0.4,  0.4>)
}


#declare plate_02 = mesh {
  do_box(<-0.1, -0.5, -0.5>, <0, 0.5, 0.5>) // main part
  do_box(<0, -0.45, -0.3>, <0.05, 0.2, -0.4>)
  do_box(<0, -0.1, -0.1>, <0.13, 0.1, 0.1>)
  do_box(<-0.1, -0.6, -0.4>, <0.12, -0.5, 0.4>)
}


#declare plate_03 = mesh {
  do_box(<-0.1, -0.5, -0.5>, <0, 0.5, 0.5>) // main part
  do_box(<0, 0.3, 0.43>, <0.31, 0.4, 0.3>) // towery part
  do_box(<0, 0.3, 0.2>, <0.27, 0.4, -0.43>) // towery part
  do_box(<0, 0, 0.43>, <0.23, -0.2, -0.43>) // towery part
  do_box(<-0.3, 0.6, -0.56>, <0.2, -0.1, -0.49>) // towery part
  do_box(<-0.3, -0.11, -0.56>, <0.13, -0.6, -0.49>) // towery part
}


#declare plate_04 = mesh {
  do_box(<-0.1, -0.5, -0.5>, <0, 0.5, 0.5>) // main part
  do_box(<-0.1, -0.45, -0.4>, <0.05, -0.6, 0.4>)
  do_box(<-0.1, -0.41, -0.46>, <0.02, 0.37, 0.6>)
  do_box(<-0, 0.42, 0.48>, <0.2, 0.23, 0.24>)
  do_box(<-0, -0.2, 0.1>, <0.1, -0.4, -0.2>)
}


#macro  do_plate(x_offset, eliv, roty)
  object {
    #local feep = int(4 * rand(rseed));
    #switch(feep)
      #case (0)
        plate_01
        #break
      #case (1)
        plate_02
        #break
      #case (2)
        plate_03
        #break
      #else
        plate_04
    #end
    rotate x*90*int(4 * rand(rseed))
    translate <x_offset, 0, 0>
    rotate z*eliv
    rotate y*roty
  }
#end


union { // the death star type object itself
  #declare elevation = 0;
  #while (elevation < 90)
    #declare y_factor = cos(radians(elevation));
    #declare y_factor = max(1, int(y_factor * 119));
    #declare roty = 0;
    #while (roty < 360)
      #if (elevation > 0)
        do_plate(20, -elevation, roty)
      #end
      do_plate(20, elevation, roty)
      #declare roty = roty + (360 / y_factor);
    #end
    #declare elevation = elevation + (90 / 30);
  #end
  pigment { color rgb 1 }
  finish { ambient 0 diffuse 1 }
  rotate z*100
  translate <-7, 18.5, -2>
}


// frame
#declare p1 = <-1,  1, -17>;
#declare p2 = < 1,  1, -17>;
#declare p3 = < 1, -1, -17>;
#declare p4 = <-1, -1, -17>;
#declare frt = 0.005;


light_source {
  <220, -1500, 3000>
  color rgb 1
  looks_like {
    sphere {
      0, 40
      hollow
      pigment { color rgbf <1, 1, 1, 1> }
      finish { ambient 1 diffuse 0 }
      interior {
        media {
          emission 1
          density {
            spherical
            scale 40
            color_map {
              [ 0.0 color rgb 0 ]
              [ 1.0 color rgb 1/40 ]
            }
          }
        }
      }
    }
  }
}


/* actual end of this file */


Post a reply to this message

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