Graphics Programs Reference
In-Depth Information
2
1
2
3 3
4
4
1
(a)
1
22
3
4
3
4
1
(b)
Figure 4.11: Off-Axis Fisheye Projection.
contrast, points 3 and 4 are shifted more when the viewer is off-axis, thereby distorting
those parts of the image on the “right” side.
Figure 4.12 illustrates the overall effect of an off-axis projection. It shows 50 points
moved toward an off-axis viewer. In the three parts of the figure, from left to right, the
viewer is located at (10 , 0), (
5 , 5), and (0 , 5). This figure illustrates the effects of the
viewer being off-axis and ignores the distortions (such as straight lines transformed into
curves) introduced by the fisheye projection itself.
k = 10; n = 50; scal[q_] := (k Tan[ArcTan[q/k]/2])/q;
P = Table[{Random[Real, {-10.,10.}], Random[Real, {-10.,10.}]}, {n}];
x=-5;y=5;(*Location of viewer *)
Pt=P-Table[{x, y}, {n}];
Q = Table[Sqrt[Pt[[i]].Pt[[i]]], {i, n}];
L = Table[Line[{P[[i]]+{x, y}, (scal[Q[[i]]] P[[i]])+{x, y}}], {i, n}];
Show[Graphics[L], Graphics[Circle[{0, 0}, k]],
Graphics[{AbsolutePointSize[5], Point[{0, 0}]}],
Graphics[{AbsolutePointSize[5], Point[{x, y}]}],
AspectRatio -> Automatic, PlotRange -> All]
Figure 4.12: Off-Axis Fisheye Projection and Code.
 
Search WWH ::




Custom Search