Descriptions and Samples for the POV-Ray Raytracer by Friedrich A. Lohmüller
    deutsche Version

Canoe in the water overview Door macro

Window

The Construction of a Window.

Objects: "box"
Methods: "difference", "union", "declare"
Front view (View in z-direction)

The construction in details:

The frame of the window first is formed by a difference of a flat box in the size of the outlines minus some boxes in the size of the openings for the glass. The result of that difference gets the colour of the window frame. Then a flat box with a glass texture is added by a union statement.
It's not necessary to use a glass material (with a defined glass ior and real refraction) when we want to have a window glass. Using glass material only slows down the speed of the rendering - at a thin window glass refraction gives no visible effect!

The jellow boxes where subtracted from the white box!
//--------------------- Window -----------
#declare Windtex = 
texture{pigment{color White}
        finish {ambient 0.1 diffuse 0.9}}
//-----------------------------------------
#declare Window = 
union{
 difference{
  box{<-0.50,0.80,-0.02>,< 0.50,1.80,0.02>}
  box{<-0.45,0.85,-0.03>,<-0.03,1.27,0.03>}
  box{< 0.03,0.85,-0.03>,< 0.45,1.27,0.03>}
  box{<-0.45,1.33,-0.03>,< 0.03,1.75,0.03>}
  box{< 0.03,1.33,-0.03>,< 0.45,1.75,0.03>}
  texture{Windtex1}
  } // ---end of difference 
 box{<-0.49,0.81,0.0>,< 0.49,1.79,0.001>
 texture{T_Glass3}}
 } // ---end of union
// Attention: avoid coincident surfaces!!
//--------- end of window definition -------

//Draw the window:
object{Window translate<0,0,0>} 
//------------------------------------- end
This makes to following image
Click here for the complete scene description
for POV-Ray: ".txt" file or ".pov" file


Canoe in the water overview Door macro

© Friedrich A. Lohmüller, 2003     email email: (legacy email redacted)