POV-Ray : Newsgroups : povray.binaries.images : Rendering issues : Re: Rendering issues Server Time
5 Nov 2024 02:20:37 EST (-0500)
  Re: Rendering issues  
From: jhu
Date: 12 Jan 2008 18:30:00
Message: <web.47894c446c6c555f7bcf5ca50@news.povray.org>
Here's the relevant code with comments. It's basically a box differenced with
other objects and isosurfaces.

  light_source{
    <0,1,0>
    White
  }
  camera {
    location <0,1.75,0>
    look_at  <0,1.75,10>
    rotate y*-12
    translate <1.75,0,-3>
    right <450/300,0,0>
  }


#declare fn_Pigm=function {
  pigment {
    agate
    color_map {
      [0 color rgb 0]
      [1 color rgb 1]
    }
  }
}

  difference{
    box{<-200,-1,-100>, <200,200,7.5>}  //the main room

    // the +z room with window
    union{
      box{<-2.5,-.001,2>, <2.5,10,6>}
      difference{ //makes the hole for the door on the +z side of the room
        #declare R=5;
        #declare H=3;
        cylinder{<0,0,5.9>, <0,0,10>, R}
        box{<-100, -100, -100>, <-1.25,100, 100>}
        box{<1.25, -100, -100>, <100,100, 100>}
        box{<-100,-100,-100>, <100, 5-H,100>}
        translate y*-R
        translate y*H
      }
    }

    //the camera room
    box{<-2.5,-.001,-9>, <5,6.0001,1.5>} // room with camera
    difference{//makes archway to connect camera room with +z room
      cylinder{<0,0,.9>, <0,0,2.1>, 2.5 translate y*1.25}
      box{<-100, -100, -100>, <100,-.0001,100>}
    }

    isosurface{//makes the camera room have stucco
      function{(y*y+x*x-2.5*2.5)-fn_Pigm(x*2, y*2, z*2).gray*0.1}
      accuracy 0.0001
      max_gradient 9
      contained_by {box {<-10,-10,.9> <10,10,2.5>}}
      translate <0,1.25,0>
      pigment{White}
    }


    isosurface{//makes the camera room have stucco
      function{max((y*y-(3*3)),(x*x-(3.75*3.75)),(z*z-(5.25*5.25)))-fn_Pigm(x*2,
y*2, z*2).gray*0.1}
      accuracy 0.0001
      max_gradient 20
      contained_by {box {-20 20}}
      pigment{White}
      translate <3.75-2.5,3.05,-(5.25-1.5)>
    }


    //the -x room
    box{<-2.49999,-.001,-9>, <2.49999,6.0001,1.5> translate x*(-5.5)}
    difference{//make the archway connecting the camera room to the -x room
      cylinder{<-5,0,0>, <-2.4,0,0>, 2.5 translate <0,1.25,-1>}
      box{<-100, -100, -100>, <100,-.0001,100>}
    }
    pigment{White}
  }


Post a reply to this message

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