// +w480 +h240
#version 3.6; //[sic]


#declare Camera_Location = <0, 3.8, -7.5958>;

#declare Camera_Look_At = <0, 1, 0>;
#include "screen.inc"
Set_Camera_Angle(50)

global_settings { assumed_gamma 1 max_trace_level 20}

#declare Quad =
#switch(clock)
#case(0)
 quadric { <1, 0, 1>, <0, 0, 0>, <0, -1, 0>, -1/9 } 
#declare Equation=" <1, 0, 1>, <0, 0, 0>, <0, -1, 0>, -1/9 "; 
#declare Comment=" paraboloid y/up, translated down by 0.11";
#break

#case(1)
 quadric { <1, 0, 1>, <0, 0, 0>, <0, -1, 0>, -1/4 } 
#declare Equation=" <1, 0, 1>, <0, 0, 0>, <0, -1, 0>, -1/4 "; 
#declare Comment=" paraboloid y/up, translated down by 0.25";
#break

#case(2)
 quadric { <1, 0, 1>, <0, 0, 0>, <0, -1, 0>, -1 } 
#declare Equation=" <1, 0, 1>, <0, 0, 0>, <0, -1, 0>, -1 ";   
#declare Comment=" paraboloid y/up, translated down by 1";
#break

#case(3)
 quadric { <1, 0, 1>, <0, 0, 0>, <0, -1, 0>, 1/9 } 
#declare Equation=" <1, 0, 1>, <0, 0, 0>, <0, -1, 0>, 1/9 ";  
#declare Comment=" paraboloid y/up, translated up by 0.11";
#break

#case(4)
 quadric { <1, 0, 1>, <0, 0, 0>, <0, -1, 0>, 1/4 } 
#declare Equation=" <1, 0, 1>, <0, 0, 0>, <0, -1, 0>, 1/4 ";  
#declare Comment=" paraboloid y/up, translated up by 0.25";
#break

#case(5)
 quadric { <1, 0, 1>, <0, 0, 0>, <0, -1, 0>, 0 } 
#declare Equation=" <1, 0, 1>, <0, 0, 0>, <0, -1, 0>, 0 ";    
#declare Comment=" paraboloid y/up, at origin";
#break

#case(6)
 quadric { <0, 1, 1>, <0, 0, 0>, <-1, 0, 0>, 0 } 
#declare Equation=" <0, 1, 1>, <0, 0, 0>, <-1, 0, 0>, 0 ";    
#declare Comment=" paraboloid x/right, at origin";
#break

#case(7)
 quadric { <0, 1, 1>, <0, 0, 0>, <-1, 0, 0>, -1/2 } 
#declare Equation=" <0, 1, 1>, <0, 0, 0>, <-1, 0, 0>, -1/2 "; 
#declare Comment=" paraboloid x/right, translated left by 0.5";
#break

#case(8)
 quadric { <0, 1, 1>, <0, 0, 0>, <-1, 0, 0>, 1/2 } 
#declare Equation=" <0, 1, 1>, <0, 0, 0>, <-1, 0, 0>, 1/2 ";  
#declare Comment=" paraboloid x/right, translated right by 0.5";
#break

#case(9)
 quadric { <0, 1, 1>, <0, 0, 0>, <-1, 0, 0>, 1/9 } 
#declare Equation=" <0, 1, 1>, <0, 0, 0>, <-1, 0, 0>, 1/9 ";  
#declare Comment=" paraboloid x/right, translated right by 0.11";
#break

#case(10)
 quadric { <0, 1, 1>, <0, 0, 0>, <-1, 0, 0>, -1/9 } 
#declare Equation=" <0, 1, 1>, <0, 0, 0>, <-1, 0, 0>, -1/9 "; 
#declare Comment=" paraboloid x/right, translated left by 0.11";
#break

#case(11)
 quadric { <0, 1, 1>, <0, 0, 0>, <-1, 0, 0>, -1/2 } 
#declare Equation=" <0, 1, 1>, <0, 0, 0>, <-1, 0, 0>, -1/2 ";   
#declare Comment=" paraboloid x/right, translated left by 1/2";
#break

#case(12)
 quadric { <1, 1, 0>, <0, 0, 0>, <0, 0, -1>, 0 } 
#declare Equation=" <1, 1, 0>, <0, 0, 0>, <0, 0, -1>, 0 ";    
#declare Comment=" paraboloid z/away, at origin";
#break

#case(13)
 quadric { <1, 1, 0>, <0, 0, 0>, <0, 0, -1>, -1/2 } 
#declare Equation=" <1, 1, 0>, <0, 0, 0>, <0, 0, -1>, -1/2 ";    
#declare Comment=" paraboloid z/away, translated forward by 1/2";
#break

#case(14)
 quadric { <1, 1, 0>, <0, 0, 0>, <0, 0, -1>, -1/4 } 
#declare Equation=" <1, 1, 0>, <0, 0, 0>, <0, 0, -1>, -1/4 ";  
#declare Comment=" paraboloid z/away, translated forward by 0.25";
#break

#case(15)
 quadric { <1, 1, 0>, <0, 0, 0>, <0, 0, -1>, 1/4 } 
#declare Equation=" <1, 1, 0>, <0, 0, 0>, <0, 0, -1>, 1/4 ";   
#declare Comment=" paraboloid z/away, translated backward by 0.25 ";
#break

#case(16)
 quadric { <1, 1, 0>, <0, 0, 0>, <0, 0, -1>, -1/2 } 
#declare Equation=" <1, 1, 0>, <0, 0, 0>, <0, 0, -1>, -1/2 ";   
#declare Comment=" paraboloid z/away, translated forward by 0.5 ";
#break

#case(17)
 quadric { <1, 1, 0>, <0, 0, 0>, <0, 0, -1>, 1/2 } 
#declare Equation=" <1, 1, 0>, <0, 0, 0>, <0, 0, -1>, 1/2 ";   
#declare Comment=" paraboloid z/away, translated backward by 0.5 ";
#break

#case(18)
 quadric { <1, 1, -1>, <0, 0, 0>, <0, 0, 0>, -1/10 } 
#declare Equation=" <1, 1, -1>, <0, 0, 0>, <0, 0, 0>, -1/10 ";   
#declare Comment=" hyperboloid z, at origin";
#break

#case(19)
 quadric { <1, 1, -1>, <0, 0, 0>, <0, 0, 1>, (-1/10-(1/4)) } 
#declare Equation=" <1, 1, -1>, <0, 0, 0>, <0, 0, 1>, (-1/10-(1/4)) ";   
#declare Comment=" hyperboloid z, translated backward by 1/2 ";
#break

#case(20)
 quadric { <1, 1, -1>, <0, 0, 0>, <0, 0, -1>, (-1/10-(1/4)) } 
#declare Equation=" <1, 1, -1>, <0, 0, 0>, <0, 0, -1>, (-1/10-(1/4)) ";   
#declare Comment=" hyperboloid z, translated forward by 1/2 ";
#break

#case(21)
 quadric { <1, -1, 1>, <0, 0, 0>, <0, 0, 0>, -1/10 } 
#declare Equation=" <1, -1, 1>, <0, 0, 0>, <0, 0, 0>, -1/10 ";   
#declare Comment=" hyperboloid y, at origin";
#break

#case(22)
 quadric { <1, -1, 1>, <0, 0, 0>, <0, 2, 0>, (-1/10-(1)) } 
#declare Equation=" <1, -1, 1>, <0, 0, 0>, <0, 2, 0>, (-1/10-(1)) ";   
#declare Comment=" hyperboloid y, translated up by 1";
#break

#case(23)
 quadric { <1, -1, 1>, <0, 0, 0>, <0, -2, 0>, (-1/10-(1)) } 
#declare Equation=" <1, -1, 1>, <0, 0, 0>, <0, -2, 0>, (-1/10-(1)) ";   
#declare Comment=" hyperboloid y, translated down by 1 ";
#break

#case(24)
 quadric { <-1, 1, 1>, <0, 0, 0>, <0, 0, 0>, -1/10 } 
#declare Equation=" <-1, 1, 1>, <0, 0, 0>, <0, 0, 0>, -1/10 ";   
#declare Comment=" hyperboloid x, at origin";
#break

#case(25)
 quadric { <-1, 1, 1>, <0, 0, 0>, <0, -1, 0>, (-1/10+(1/4)) } 
#declare Equation=" <-1, 1, 1>, <0, 0, 0>, <0, -1, 0>, (-1/10+(1/4)) ";   
#declare Comment=" hyperboloid x, translated up by 1/2";
#break

#case(26)
 quadric { <-1, 1, 1>, <0, 0, 0>, <0, 1, 0>, (-1/10+(1/4)) } 
#declare Equation=" <-1, 1, 1>, <0, 0, 0>, <0, 1, 0>, (-1/10+(1/4)) ";   
#declare Comment=" hyperboloid x, translated down by 1/2";
#break

#case(27)
 quadric { <-1, 1, 1>, <0, 0, 0>, <0, -2, 0>, (-1/10+(1)) } 
#declare Equation=" <-1, 1, 1>, <0, 0, 0>, <0, -2, 0>, (-1/10+(1)) ";   
#declare Comment=" hyperboloid x, translated up by 1";
#break

#case(28)
 quadric { <-1, 1, 1>, <0, 0, 0>, <0, 2, 0>, (-1/10+(1)) } 
#declare Equation=" <-1, 1, 1>, <0, 0, 0>, <0, 2, 0>, (-1/10+(1)) ";   
#declare Comment=" hyperboloid x, translated down by 1";
#break

#case(29)
 quadric { <1, 1, -1>, <0, 0, 0>, <0, 0, 0>, 0 } 
#declare Equation=" <1, 1, -1>, <0, 0, 0>, <0, 0, 0>, 0 ";   
#declare Comment=" cone z , at origin";
#break

#case(30)
 quadric { <1, 1, -1>, <0, 0, 0>, <0, -2/3, 0>, 1/9 } 
#declare Equation=" <1, 1, -1>, <0, 0, 0>, <0, -2/3, 0>, 1/9 ";   
#declare Comment=" cone z , translated up by 1/3";
#break

#case(31)
 quadric { <1, 1, -1>, <0, 0, 0>, <0, 2/3, 0>, 1/9 } 
#declare Equation=" <1, 1, -1>, <0, 0, 0>, <0, 2/3, 0>, 1/9 ";   
#declare Comment=" cone z , translated down by 1/3";
#break

#case(32)
 quadric { <-1, 1, 1>, <0, 0, 0>, <0, 0, 0>, 0 } 
#declare Equation=" <-1, 1, 1>, <0, 0, 0>, <0, 0, 0>, 0 ";   
#declare Comment=" cone x , at origin";
#break

#case(33)
 quadric { <-1, 1, 1>, <0, 0, 0>, <0, -2/3, 0>, 1/9 } 
#declare Equation=" <-1, 1, 1>, <0, 0, 0>, <0, -2/3, 0>, 1/9 ";   
#declare Comment=" cone x , translated up by 1/3";
#break

#case(34)
 quadric { <-1, 1, 1>, <0, 0, 0>, <0, 2/3, 0>, 1/9 } 
#declare Equation=" <-1, 1, 1>, <0, 0, 0>, <0, 2/3, 0>, 1/9 ";   
#declare Comment=" cone x , translated down by 1/3";
#break

#case(35)
 quadric { <1, -1, 1>, <0, 0, 0>, <0, 0, 0>, 0 } 
#declare Equation=" <1, -1, 1>, <0, 0, 0>, <0, 0, 0>, 0 ";   
#declare Comment=" cone y , at origin";
#break

#case(36)
 quadric { <1, -1, 1>, <0, 0, 0>, <0, 2/3, 0>, -1/9 } 
#declare Equation=" <1, -1, 1>, <0, 0, 0>, <0, 2/3, 0>, -1/9 ";   
#declare Comment=" cone y , translated up by 1/3";
#break

#case(37)
 quadric { <1, -1, 1>, <0, 0, 0>, <0, -2/3, 0>, -1/9 } 
#declare Equation=" <1, -1, 1>, <0, 0, 0>, <0, -2/3, 0>, -1/9 ";   
#declare Comment=" cone y , translated down by 1/3";
#break

#case(38)
 quadric { <1, 1, 0>, <0, 0, 0>, <0, 0, 0>, -1/2 } 
#declare Equation=" <1, 1, 0>, <0, 0, 0>, <0, 0, 0>, -1/2 ";   
#declare Comment=" cylinder z , at origin";
#break

#case(39)
 quadric { <1, 1, 0>, <0, 0, 0>, <0, -1, 0>, -1/2+1/4 } 
#declare Equation=" <1, 1, 0>, <0, 0, 0>, <0, -1, 0>, -1/2+1/4 ";   
#declare Comment=" cylinder z , translated up by 1/2";
#break

#case(40)
 quadric { <1, 1, 0>, <0, 0, 0>, <0, 1, 0>, -1/2+1/4 } 
#declare Equation=" <1, 1, 0>, <0, 0, 0>, <0, 1, 0>, -1/2+1/4 ";   
#declare Comment=" cylinder z , translated down by 1/2";
#break

#case(41)
 quadric { <0, 1, 1>, <0, 0, 0>, <0, 0, 0>, -1/2 } 
#declare Equation=" <0, 1, 1>, <0, 0, 0>, <0, 0, 0>, -1/2 ";   
#declare Comment=" cylinder x , at origin";
#break

#case(42)
 quadric { <0, 1, 1>, <0, 0, 0>, <0, -1, 0>, -1/2+1/4 } 
#declare Equation=" <0, 1, 1>, <0, 0, 0>, <0, -1, 0>, -1/2+1/4 ";   
#declare Comment=" cylinder x , translated up by 1/2";
#break

#case(43)
 quadric { <0, 1, 1>, <0, 0, 0>, <0, 1, 0>, -1/2+1/4 } 
#declare Equation=" <0, 1, 1>, <0, 0, 0>, <0, 1, 0>, -1/2+1/4 ";   
#declare Comment=" cylinder x , translated down by 1/2";
#break

#case(44)
 quadric { <1, 1, 1>, <0, 0, 0>, <0, 0, 0>, -1 } 
#declare Equation=" <1, 1, 1>, <0, 0, 0>, <0, 0, 0>, -1 ";   
#declare Comment=" ellipsoid , at origin";
#break

#case(45)
 quadric { <1, 1, 1>, <0, 0, 0>, <0, -1, 0>, -1+1/4 } 
#declare Equation=" <1, 1, 1>, <0, 0, 0>, <0, -1, 0>, -1+1/4 ";   
#declare Comment=" ellipsoid , translated up by 1/2";
#break

#case(46)
 quadric { <1, 1, 1>, <0, 0, 0>, <0, 1, 0>, -1+1/4 } 
#declare Equation=" <1, 1, 1>, <0, 0, 0>, <0, 1, 0>, -1+1/4 ";   
#declare Comment=" ellipsoid , translated down by 1/2";
#break

#case(47)
 quadric { <1, 1, -1>, <0, 0, 0>, <0, 0, 0>, 1/10 } 
#declare Equation=" <1, 1, -1>, <0, 0, 0>, <0, 0, 0>, 1/10 ";   
#declare Comment=" hyperboloid z, at origin";
#break

#case(48)
 quadric { <1, 1, -1>, <0, 0, 0>, <0, 0, 1>, (1/10-(1/4)) } 
#declare Equation=" <1, 1, -1>, <0, 0, 0>, <0, 0, 1>, (1/10-(1/4)) ";   
#declare Comment=" hyperboloid z, translated backward by 1/2 ";
#break

#case(49)
 quadric { <1, 1, -1>, <0, 0, 0>, <0, 0, -1>, (1/10-(1/4)) } 
#declare Equation=" <1, 1, -1>, <0, 0, 0>, <0, 0, -1>, (1/10-(1/4)) ";   
#declare Comment=" hyperboloid z, translated forward by 1/2 ";
#break

#case(50)
 quadric { <1, -1, 1>, <0, 0, 0>, <0, 0, 0>, 1/10 } 
#declare Equation=" <1, -1, 1>, <0, 0, 0>, <0, 0, 0>, 1/10 ";   
#declare Comment=" hyperboloid y, at origin";
#break

#case(51)
 quadric { <1, -1, 1>, <0, 0, 0>, <0, 2, 0>, (1/10-(1)) } 
#declare Equation=" <1, -1, 1>, <0, 0, 0>, <0, 2, 0>, (1/10-(1)) ";   
#declare Comment=" hyperboloid y, translated up by 1";
#break

#case(52)
 quadric { <1, -1, 1>, <0, 0, 0>, <0, -2, 0>, (1/10-(1)) } 
#declare Equation=" <1, -1, 1>, <0, 0, 0>, <0, -2, 0>, (1/10-(1)) ";   
#declare Comment=" hyperboloid y, translated down by 1 ";
#break

#case(53)
 quadric { <-1, 1, 1>, <0, 0, 0>, <0, 0, 0>, 1/10 } 
#declare Equation=" <-1, 1, 1>, <0, 0, 0>, <0, 0, 0>, 1/10 ";   
#declare Comment=" hyperboloid x, at origin";
#break

#case(54)
 quadric { <-1, 1, 1>, <0, 0, 0>, <0, -1, 0>, (1/10+(1/4)) } 
#declare Equation=" <-1, 1, 1>, <0, 0, 0>, <0, -1, 0>, (1/10+(1/4)) ";   
#declare Comment=" hyperboloid x, translated up by 1/2";
#break

#case(55)
 quadric { <-1, 1, 1>, <0, 0, 0>, <0, 1, 0>, (1/10+(1/4)) } 
#declare Equation=" <-1, 1, 1>, <0, 0, 0>, <0, 1, 0>, (1/10+(1/4)) ";   
#declare Comment=" hyperboloid x, translated down by 1/2";
#break

#case(56)
 quadric { <-1, 1, 1>, <0, 0, 0>, <0, -2, 0>, (1/10+(1)) } 
#declare Equation=" <-1, 1, 1>, <0, 0, 0>, <0, -2, 0>, (1/10+(1)) ";   
#declare Comment=" hyperboloid x, translated up by 1";
#break

#case(57)
 quadric { <-1, 1, 1>, <0, 0, 0>, <0, 2, 0>, (1/10+(1)) } 
#declare Equation=" <-1, 1, 1>, <0, 0, 0>, <0, 2, 0>, (1/10+(1)) ";   
#declare Comment=" hyperboloid x, translated down by 1";
#break

#case(58)
 quadric { <1, 0, 1>, <0, 0, 0>, <0, 1, 0>, -1/9 } 
#declare Equation=" <1, 0, 1>, <0, 0, 0>, <0, 1, 0>, -1/9 "; 
#declare Comment=" paraboloid y/down, translated up by 0.11";
#break

#case(59)
 quadric { <1, 0, 1>, <0, 0, 0>, <0, 1, 0>, -1/4 } 
#declare Equation=" <1, 0, 1>, <0, 0, 0>, <0, 1, 0>, -1/4 "; 
#declare Comment=" paraboloid y/down, translated up by 0.25";
#break

#case(60)
 quadric { <1, 0, 1>, <0, 0, 0>, <0, 1, 0>, -1 } 
#declare Equation=" <1, 0, 1>, <0, 0, 0>, <0, 1, 0>, -1 ";   
#declare Comment=" paraboloid y/down, translated up by 1 ";
#break

#case(61)
 quadric { <1, 1, 1>, <0, 0, 0>, <0, 0, 0>, -1/2 } 
#declare Equation=" <1, 1, 1>, <0, 0, 0>, <0, 0, 0>, -1/2 ";   
#declare Comment=" ellipsoid , at origin";
#break

#case(62)
 quadric { <1, 1, 1>, <0, 0, 0>, <0, -1, 0>, -1/2+1/4 } 
#declare Equation=" <1, 1, 1>, <0, 0, 0>, <0, -1, 0>, -1/2+1/4 ";   
#declare Comment=" ellipsoid , translated up by 1/2";
#break

#case(63)
 quadric { <1, 1, 1>, <0, 0, 0>, <0, 1, 0>, -1/2+1/4 } 
#declare Equation=" <1, 1, 1>, <0, 0, 0>, <0, 1, 0>, -1/2+1/4 ";   
#declare Comment=" ellipsoid , translated down by 1/2";
#break

#end


#default { finish { diffuse 0.6 ambient rgb 0.15618 } }

light_source
{ <-4.3125, 9.6250, -7.4695>,
  rgb 6856.3
  fade_power 2 fade_distance 0.10417
  spotlight point_at <0, 1, 0> radius 45 falloff 90
}
box
{ -<9, 11, 9>*19, <9, 11, 9>*19
hollow
  pigment { rgb 1 }
}

plane
{ y, 0
  pigment { checker rgb 0.75 rgb 1 }
}

// OK in POV-Ray 3.6 and 3.7

  cylinder { 0, y, 1 
  pigment { blue 0.5 filter 0.75 }
  translate <-1, 1, 2>
}
  cylinder { -y, y, 1 
  pigment { red 0.5 filter 0.75 }
  translate <1, 1, 2>
}

#declare Obj2 =
intersection
{ object{ Quad }
  //box { <-1,0,-1>,1 }
  cylinder { 0, y, 1 }
  pigment { green 0.5 filter 0.75 }
  translate <-1, 1, 0>
}


// OK in POV-Ray 3.6; not rendered in 3.7

#declare Obj=
intersection
{ 
object { Quad }
  //box { -1,1 }
  cylinder { -y, y, 1 }
  pigment { green 0.5 red 0.5 filter 0.75 }
  translate <1, 1, 0>
} 

#debug "Intersection \n"
#debug concat("Min : ",vstr(3,min_extent(Obj),"," ,3,4),"\n")
#debug concat("Max : ",vstr(3,max_extent(Obj),"," ,3,4),"\n")
object { Obj }
box { min_extent(Obj), max_extent(Obj) translate 2*x pigment { blue 0.5 red 0.5 } }

#debug "Shorter\n"
#debug concat("Min : ",vstr(3,min_extent(Obj2),"," ,3,4),"\n")
#debug concat("Max : ",vstr(3,max_extent(Obj2),"," ,3,4),"\n")

#declare Shorter= concat("Left Min : <",vstr(3,min_extent(Obj2),"," ,3,2),"> Max : <",vstr(3,max_extent(Obj2),"," ,3,2),">");

#declare Full= concat("Right Min : <",vstr(3,min_extent(Obj),"," ,3,2),"> Max : <",vstr(3,max_extent(Obj),"," ,3,2),">");

object { Obj2 }
box { min_extent(Obj2), max_extent(Obj2) translate -2*x pigment { blue 0.5 green 0.5 } }
 

#declare Bar =text { ttf "timesbd" Comment .01,<0,0> texture { pigment { rgb 0 } } scale 1/16 }

#declare Foo =text { ttf "VeraMono" Equation .01,<0,0> texture { pigment { rgb 0 } } scale 1/28 }

#declare SFoo =text { ttf "VeraMono" Shorter .01,<0,0> texture { pigment { rgb 0 } } scale 1/28 }

#declare FFoo =text { ttf "VeraMono" Full .01,<0,0> texture { pigment { rgb 0 } } scale 1/28 }
Screen_Object(Foo, <0.0,0.9>, 0.02, true, 0.1)
Screen_Object(Bar, <0.0,1.0>, 0.02, true, 0.1)
Screen_Object(SFoo, <0.0,0.1>, 0.02, true, 0.1)
Screen_Object(FFoo, <0.0,0.0>, 0.02, true, 0.1)
