Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmueller
Deutsch Deutsch

Home
back to overview
- POV-Ray Tutorials

  - Analytical Geometry
    with POV-Ray
    - Index -
  - Insert Menu Add-on
    & Download
 
  - Basics
    Possibilities and Needs

    Points & Lines
    - Points in 3D
    - Line Sections, Straight,
      Vectors, Distance Markers
    - Surfaces & Planes
    - Output of Results,
      Captions
    - Points of Intersection
    - Circles
    Solids
    - Tetrahedron
    - Parallelepiped
    - Round Solids
    -
  - Overview by Table
      on "analytical_g.inc"
  - Vector Analysis
      with POV-Ray
  - Righthanded & Lefthanded
    Systems of Coordinates
    and the Cross Product

  - Samples from
    Analytical Geometry
    - Parallelogram of the
        Middles of the Edges
    - Trace Points of a Straight Line
    - Calculations
      about a Triangle

    - Area of a Parallelogram
        and Cross Product
   > Shadow of a Pyramid
    - Hit a plane || yz-plane
    - Angle of triangle & yz-plane
                                       

Analytical Geometry with POV-Ray

- Samples -

    The Shadow of a Pyramid

Calculations of the Shadow of a Pyramid with POV-Ray
A quadratic pyramid is defined by the height H = 4 m and the base width of R = 6 m. The center of the base is at the center of the coordinate system.
The direction of the parallel light is given by the vector L = <-2,-1,-1.5>.
Which coordinates has the shadow of the tip of the pyramid?

#declare R = 6 ;
#declare H = 4 ;
// vertex of the pyramid:
#declare S = < 0, H, 0 >;
// corners of the base:
#declare A  = <-R/2, 0.0, R/2>;
#declare B  = <-R/2, 0.0,-R/2>;
#declare C  = < R/2, 0.0,-R/2>;
#declare D  = < R/2, 0.0, R/2>;
// the light beam through S:
#declare L = < -2, -1, -1.5>
The shadow F of the pyramid tip S is the xz trace point of the straight line through S with the direction L. This value can be calculated with POV-Ray easily:

// F = xz trace point of the beam through S:
#declare F  = S -(S.y/L.y)*L ; 
( here: S.y = H = the y component of S,
  L.y = the y component of L.)
The equation of the straight line through S with the direction L is :
x1 = 0 + v * (-2   )
x2 = H + v * (-1   )
x3 = 0 + v * (-1.5)

For the xz trace point we have here x2 = 0,
i.e. 0 = H + v * (-1 ) or v = H. From there the wanted xz trace point has the coordinates
F = ( -8 / 0 / -6 ).
Calculations of the Shadow of a Pyramid
This scene for POV-Ray: ".txt" file or ".pov" file
top

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