Graphics Reference
In-Depth Information
V
R
R'
Side
Front
Figure 4.20. Spherical coordinate preview of a specular lobe for a complicated distribu-
tion. We can clearly see that the lobe does not necessarily need to be centered around
the pure reflection vector. If we average all the vectors within the lobe, we get a new
reflection vector R that represents our reflection direction more precisely.
Once we have the length for our intersection, we can assume that it's the
adjacent side of our isosceles triangle. With some simple trigonometry we can
calculate the opposite side as well. Trigonometry says that the tangent of θ is
the opposite side over the adjacent side:
tan( θ )= opp
adj .
Using some simple algebra we discover that the opposite side that we are looking
for is the tangent of θ multiplied by the adjacent side:
opp =tan( θ ) adj.
However, this is only true for right triangles. If we look at an isosceles triangle,
we discover that it's actually two right triangles fused over the adjacent side where
one is flipped. This means the opposite is actually twice the opposite of the right
triangle:
opp =2tan( θ ) adj (4.2)
Once we have both the adjacent side and the opposite side, we have all the data we
need to calculate the sampling points for the cone-tracing pass. (See Figure 4.21.)
To calculate the in-radius (circle radius touching all three sides) of an isosceles
triangle, this equation can be used:
r = a ( a 2 +4 h 2
a )
,
4 h
where a is the base of the isosceles triangle, h is the height of the isosceles triangle,
and r is the resulting in-radius. Recall that the height of the isosceles triangle is
Search WWH ::




Custom Search