POV-Ray : Newsgroups : povray.text.scene-files : spherical warp tile Server Time
1 Nov 2024 03:17:23 EDT (-0400)
  spherical warp tile (Message 1 to 1 of 1)  
From: Pete
Subject: spherical warp tile
Date: 22 Jul 2001 22:17:13
Message: <3240.602T2461T13575814PeterC@nym.alias.net>
/*
   Change the image_map statement to use whatever
   image you have sitting around on your system
*/
#declare ntsc = false;
#declare rseed = seed(32779419);


global_settings {
  assumed_gamma 2.2
  number_of_waves 9
  max_trace_level 6
}


#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


#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


#macro do_quad(p1, p2, p3, p4) // rotory order
  triangle { p1, p2, p3 }
  triangle { p1, p3, p4 }
#end


#macro range_rand(r1, r2)
  #local r_first = min(r1, r2);
  #local r_last = max(r1, r2);
  #local rr_result = ((r2 - r1) * rand(rseed)) + r1;
  rr_result
#end


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


#declare st_01 = pigment {
  image_map {
    gif "blue_money.gif"
  }
  scale <(640/480), 1, 1>
/*
  bozo
  turbulence 3.7
  scale 0.5
  color_map {
    [ 0.0 color rgb <0, 0, 1> ]
    [ 0.5 color rgb <0, 0.7, 1> ]
    [ 1.0 color rgb 1 ]
  }
*/
  rotate z*45
  warp { // 1
    repeat <1, 0, 0>
    flip <1, 0, 0>
  }
  rotate z*-45

  rotate y*45
  warp { // 2
    repeat <-1, 0, 0>
    flip <-1, 0, 0>
  }
  rotate y*-45


  rotate z*45
  warp { // 3
    repeat <-1, 0, 0>
    flip <-1, 0, 0>
  }
  rotate z*-45

  rotate z*-45
  warp { // 3
    repeat <-1, 0, 0>
    flip <-1, 0, 0>
  }
  rotate z*45

  rotate x*45
  warp { // 3
    repeat <0, -1, 0>
    flip <0, -1, 0>
  }
  rotate x*-45

//

  warp {
    repeat <0, 1, 0>
    flip <0, 1, 0>
  }
  warp {
    repeat <1, 0, 0>
    flip <1, 0, 0>
  }
  warp {
    repeat <0, 0, 1>
    flip <0, 0, 1>
  }

}


#declare ts = sphere {
  <0, 0, 0>, 1
  pigment {
    st_01
  }
  finish { ambient 0.5 diffuse 0.5 }
}


object {
  ts
  rotate <30, 15, 19>
  translate <0, 0, 0>
}

object {
  ts
  rnd_rotate()
  translate <sin(0) * 2.5,  cos(0) * 2.5, 5>
}
object {
  ts
  rnd_rotate()
  translate <sin(radians(120)) * 2.5,  cos(radians(120)) * 2.5, 5>
}
object {
  ts
  rnd_rotate()
  translate <sin(radians(240)) * 2.5,  cos(radians(240)) * 2.5, 5>
}


light_source {
  <-3000, 3000, -4000>
  color rgb 1
}


/* actual end of this file */


Post a reply to this message

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