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
|