POV-Ray : Newsgroups : povray.newusers : Difference fom height field. : Difference fom height field. Server Time
29 Jul 2024 00:24:01 EDT (-0400)
  Difference fom height field.  
From: Verm
Date: 27 Apr 2007 10:20:51
Message: <463206c3$1@news.povray.org>
Hi,

I'm trying to make a pediment (I think that's the architectural term for 
the triangle on top of columns on classical buildings) out of a 
height-field differenced with two sloping boxes.

Using difference I'm not successfully cutting out the triangle. (it 
works if I replace the height-field with a box) Am I missing something 
obvious in the manual... is there a good reason for this not to work?

I can get it to work if I take the intersection of the height_field with 
a suitably differenced box but this seems silly.

Also is there a way to invert the height field (I ended up inverting the 
image in an image editor).

Here's a minimal scene showing the problem (it's meant to render a 
triangle). The commented out code shows that it works with intersection.

thanks

-----------------------------------
#default {
   pigment {rgb 1}
}

camera {
   location  <0.0, 3.5, -9.0>
   //direction 1.5*z
   //right     x*image_width/image_height
   look_at   <0.0, 1,  0.0>
}

light_source {
   <-30, 30, -30>
   color rgb 1
}

#local fh = 3;
#local fl = 5;
#local fw = 4;
#local fa = degrees(asin(fh/fl))  ;

difference {
   height_field {
     png "plasma3.png"
     rotate x*-90
     translate <-0.5,0,0>
     scale <fw*2,fh,0.2>
   }
   union {
     box{<0,-0.1,-2> <fl,4,2> rotate z*-fa translate <0,fh,0>}
     box{<0,-0.1,-2> <fl,4,2> rotate z*-fa translate <0,fh,0> scale x*-1}
   }
}


/*intersection {
   height_field {
     png "plasma3.png"
     rotate x*-90
     translate <-0.5,0,0>
     scale <fw*2,fh,0.2>
   }
   difference {
     box { <-fw,0,-1> <fw,fh,1> }

     union {
       box{<0,-0.1,-2> <fl,4,2> rotate z*-fa translate <0,fh,0>}
       box{<0,-0.1,-2> <fl,4,2> rotate z*-fa translate <0,fh,0> scale x*-1}
     }
   }
} */


Post a reply to this message

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