Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
    POV-Ray Examples - How To Make Objects for POV-Ray
Italiano Italiano
Français français
Deutsch Deutsch

Home
- POV-Ray Tutorial
  - POV-Ray Examples
   Index of Content
  - Geometry
  - Architecture
    - House
    - Roof
    - Tower
    - Castle
      - 1. Tower
      - 2. Door
      - 3. Moat
      - 4. Windows
      - 5. Extended
    - Window + Door
    - Stairs
    - Pyramid
    - Columns
    - Arch
    - Fences
    - Furnitur
    - Household
  - Engineering
                                       
 
castle with moat

Castle - 3. The Moat

How To buildt a castle with towers, door, windows, moat and drawbridge
Objects: "cylinder", "cone", "box".
Methods: "#declare", "union", "difference".
Castle front
Castle with moat in frontview.
The Construction in Details: The moat is formed by subtraction of a box from the ground plane. Then this hole is filled by a plane with the texture of water situated in a deeper level.
// ground -----------------------------
difference{
  plane{<0,1,0>, 0}
  box{  <-15,-5,-15>,<15,1,15>}
   texture{
    pigment{ color rgb<0.82,0.57,0.35>}
    normal { bumps 0.75 scale 0.025 }
    finish { phong 0.1 }
   } // end of texture
  }// end of difference  --------------
// water ------------------------------
 box{<-15,-5,-15>,<15,-0.80,15>
   texture{
    T_Green_Glass
    normal {ripples 0.5 scale 0.25}}}
//-------------------------------------
tower
Click here for the scene description for POV-Ray:
".txt" file or ".pov" file

The moat is dressed inside by flat boxes as retaining walls
and the towers were shored up by cones under zero level:
//------------------------------------------------------
#declare Walltex =
  texture{pigment{color White}
          finish {diffuse 0.9 phong 1}}
#declare Rooftex =
  texture{pigment{color rgb<0.4,0,0>}
          finish {diffuse 0.9 phong 1}}
// Moat Wall -----------------------------------------
#declare M_Wall =
box {<-15.3,-6,-0.3 >,< 15.3,  0.2,0.3> rotate<-5,0,0>
     texture{Walltex}}
// zeichne 4 GrabenWalln ------------------------------
object{M_Wall rotate<0,  0,0> translate<  0,-0.25,-15>}
object{M_Wall rotate<0,180,0> translate<  0,-0.25, 15>}
object{M_Wall rotate<0, 90,0> translate<-15,-0.25,  0>}
object{M_Wall rotate<0,-90,0> translate< 15,-0.25,  0>}
//----------------------- Tower  ------------------------
#declare TR =  2.0;   //TowerRadius
#declare TH =  5.0;   //TowerHeight
//------------------------------------------------------
#declare Tower =  union{     //definiert Objekt "Tower"
cone{<0,-TH,0>,TR+1.0,<0,0,0>,TR   texture{Walltex}}
cylinder {<0,0.0,0>,<0, TH,0>,TR   texture{Walltex}}
cylinder {<0,0.0,0>,<0,0.1,0>,2.05 texture{Walltex}}
cylinder {<0,2.5,0>,<0,2.6,0>,2.05 texture{Walltex}}
cone{<0,0,0>,TR+0.5,<0,TR+0.5,0>,0
                    translate<0,TH,0> texture{Rooftex}}
cone{<0,0,0>,TR -0.2,<0,2*TR+0.5,0>,0
                    translate<0,TH,0> texture{Rooftex}}
}// ------------ end of tower - Ende Turm --------------
//------------------ the walls ------------------------
#declare Wall = union{
  box {<-4  , 0,-0.3>,<  4,3.5,0.3> }
  box {<-4.5,-6,-0.3>,<4.5,  0,0.3> rotate<-5,0,0>}
  texture{Walltex}}
// --------------- All together now -------------------
// ---------------- draw "Tower" at 4 corners:---------
object{ Tower translate<-6, 0,-6>}
object{ Tower translate< 6, 0,-6>}
object{ Tower translate< 6, 0, 6>}
object{ Tower translate<-6, 0, 6>}
// ---------------- zeichne 4 Walln -------------------
difference{
    object{Wall} // Wall with door hole  --------------
    box{<-1,0,-0.4>,<1,2,0.4>       texture{Walltex}}
    cylinder{<0,2,-0.5>,<0,2,0.5>,1 texture{Walltex}}
                              translate< 0, 0,-6>}
object{Wall rotate<0,  0, 0> translate< 0, 0, 6>}
object{Wall rotate<0, 90, 0> translate<-6, 0, 0>}
object{Wall rotate<0,-90, 0> translate< 6, 0, 0>}
// ------------------- ground inside -------------------
box {<-6,-4,-6>,< 6,0.01,6>
    texture{pigment{color Gray90}
            finish {diffuse 0.9 phong 1}}}
//-------------------------------------------------end--
back to part 2
continued at part 4
top

© Friedrich A. Lohmüller, 2006
www.f-lohmueller.de