
266 17. Real-Time Volumetric Lighting for WebGL
Considering two points, P
0
and P
1
, any point on the edge (P
1
–P
0
) may be given using
the following parametric equation:
P(t) = P
0
+ t * (P
1
– P
0
)
where t = [0,1].
We can solve this equation for (t), for a plane with normal (H) and distance (d) from
origin by plugging in the plane equation
H · P(t) + d = 0
and then solving for parameter (t), which gives
=
−− ⋅
−
0
t
PP
(17.2)
is parameter (t) gives the intersection point for one edge (P
1
–P
0
). We iterate over all
edges from the current vertex by using the edge table and obtain all intersection points.
ese points are then used to generate t