POV-Ray : Newsgroups : povray.text.scene-files : Souce code for "The remains of an iso sphere: Take 2 " : Code for my variant: peel.pov Server Time
3 Jul 2024 02:43:37 EDT (-0400)
  Code for my variant: peel.pov  
From: Michael Andrews
Date: 3 Jan 2002 05:18:32
Message: <3C343147.3000300@reading.ac.uk>
// Here's the code for my variant on the 'peel' sphere ...

// peel.pov by Mike Andrews 2002-01-03

#include "functions.inc"

// +w320 +h240 +a0.3 +fn

global_settings {
   max_trace_level 20
   assumed_gamma 1
   ambient_light 1
   #if (0)
       radiosity {
       pretrace_start 16/image_width
       pretrace_end 4/image_width
       count 50
       nearest_count 6
       error_bound 0.25
       recursion_limit 1
       low_error_factor .2
       gray_threshold 0.0
       minimum_reuse 0.01
       brightness 1

       adc_bailout 0.01/2
     }
   #end
}

#declare BC = <7/4,7/5.5,1>^(-4);

sky_sphere {
   pigment {
     gradient y
     colour_map {[0 color rgb 0.5*(1+BC)][1 rgb 0.5*BC]}
   }
}

fog {
	fog_type 2
	colour rgb BC*0.3
	distance 100
	fog_alt 6
	fog_offset -7
}

fog {
	fog_type 2
	colour rgb (1-BC)*0.5
	distance 500
	fog_alt 15
	fog_offset -7
}

camera {
   up y
   right x*image_width/image_height
   direction 3.5*z
   location <-1,1.5,-10>
   look_at 0
}

light_source {
   0*x
   color rgb 1-0.1*BC
   translate 50*vnormalize(<1,2,-2>)
   scale 400
}

#declare fn_Rad = function {
   (1-5*abs(f_r(x,y,z)-1))
   * abs(sin(2*f_th(x,y,z)+3*(f_ph(x,y,z)-pi/2)*(1+abs(f_r(x,0,z)-1))))
}

#declare fn_Peel = function {
   ((0.6-fn_Rad(x,y,z)) + 0.2*max(0, min(1, 1-f_r(x,0,z))))
   * max(0, min(1, f_r(x,0,z)))
   - 0.01*(1-100*abs(f_r(x,y,z)-1))
}

isosurface {
   function { fn_Peel(x, y, z) }
   max_gradient 6
   accuracy 0.00002
   contained_by { sphere { 0, 1.3 } }
   pigment { spherical colour_map {[0 rgb 1][0.001 rgb x]} }
   rotate -30*x
}


Post a reply to this message

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