POV-Ray : Newsgroups : povray.binaries.images : Rendering issues : Re: Rendering issues Server Time
2 Aug 2024 02:22:05 EDT (-0400)
  Re: Rendering issues  
From: Tim Attwood
Date: 13 Jan 2008 03:06:56
Message: <4789c6a0@news.povray.org>
> I'm trying to make a room with stucco by subtracting out isosurfaces. As 
> you can
> see in this test render, in the room where the camera is located the 
> stucco
> renderes as it should. However, the arrows pointing toward the archway 
> show an
> area that is subtracted out but is rendering in all black. Anyone 
> encounter
> this before with a solution?
>
Sometimes isosurfaces do that when they are used in
differences. Fortunately you can just put the differences
into the formulas for the isosurfaces...

#include "colors.inc"

global_settings {
   assumed_gamma 1
}

background{White}

light_source {
   <0,1,0>, color <1,0.9,0.7>
   fade_distance 2
   fade_power 2
}

light_source {
   <0,2.5,10>, White*0.1
   shadowless
}

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

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

#declare useIso = true;

union {
   // floor
   box { <-200,-100,-100>, <200,0,7.5>
      texture {
         pigment {Brown}
         finish {
            specular 0.8
            roughness 0.05
            reflection 0.1
         }
      }
   }

   // ceiling
   box { <-200,10,-100>, <200,200,7.5>
   }

   // near wall with arch
#if (useIso)
   isosurface {
      function { max( (abs(z)-0.25),
                      -min( max( (abs(x)-2.5),
                                 (abs(y+2.5)-2.5)),
                            (sqrt(pow(x,2) + pow(y,2)) - 2.5)
                          )
                    )
                 +fn_Pigm(x*2, y*2, z*2).gray*0.01 // texture
      }
      accuracy 0.001
      max_gradient 1.43
      contained_by {box {<-20,-10,-2>,<20,10,2>} }
      translate <0,1.25,1.75>
   }
#else
   difference {
      box { <-200,-10,1.5>,<200,10,2>}
      cylinder{<0,1.25,0.9>, <0,1.25,2.1>, 2.5}
      box {<-2.5,-10,0.9>,<2.5,1.25,2.1>}
   }
#end


   // left wall with arch
#if (useIso)
   isosurface {
      function { max( (abs(x)-0.25),
                      -min( max( (abs(z)-2.5),
                                 (abs(y+2.5)-2.5)
                               ),
                            (sqrt(pow(z,2)+pow(y,2))-2.5)
                          )
                    )
                 +fn_Pigm(x*2, y*2, z*2).gray*0.01
               }
      accuracy 0.001
      max_gradient 1.43
      contained_by {box {<-1,-10,-20>,<1,10,7.5>} }
      translate <-2.75,1.25,-1>
   }
#else
   difference {
      box { <-2.5,-10,-200>,<-3,10,7.5>}
      cylinder{<-5,0,0>, <-2.4,0,0>, 2.5 translate <0,1.25,-1>}
   }
#end

   // right wall
#if (useIso)
   isosurface {
      function { (abs(x)-0.25)
                 +fn_Pigm(x*2, y*2, z*2).gray*0.01
               }
      accuracy 0.001
      max_gradient 1.43
      contained_by {box {<-1,-10,2>,<1,10,7.5>} }
      translate <2.75,0,0>
   }
#else
   box { <2.5,-10,2>,<3,10,7.5>
   }
#end

   //far wall with door
#if (useIso)
   isosurface {
      function { max(
                    (abs(z)-0.5),
                    -max(
                        (sqrt(pow(x,2) + pow(y+2,2)) - 5),
                        (abs(x)-1.25)
                    )
                 )
                 +fn_Pigm(x*2, y*2, z*2).gray*0.01
               }
      accuracy 0.001
      max_gradient 1.43
      contained_by {box {<-20,-10,-1>,<20,10,1>} }
      translate <0,0,7>
   }
#else
   difference {
      box { <-200,-10,6>,<200,10,7.5>}
      //door
      difference {
         box {<-1.25,-200,5.9>,<1.25,5,10>}
         cylinder {<0,-2,5.9>, <0,-2,10>, 5 inverse}
      }
   }
#end
   texture {
      pigment {White}
      finish {
         specular 0.4
         roughness 0.05
      }
   }
}


Post a reply to this message


Attachments:
Download 'iso_room.jpg' (39 KB)

Preview of image 'iso_room.jpg'
iso_room.jpg


 

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