Graphics Programs Reference
In-Depth Information
Figure 3.42: Example of a Stereo Image Pair.
(* display two cubes as a stereo pair *)
Clear[Trg, Tlf, pt, e, r, qt];
Tlf={{1,0,0,0},{0,1,0,0},{0,0,0,r},{e,0,0,1}};
Trg={{1,0,0,0},{0,1,0,0},{0,0,0,r},{-e,0,0,1}};
pt={{1,1,1,1},{-1,1,1,1},{1,-1,1,1},{-1,-1,1,1},
{1,1,-1,1},{-1,1,-1,1},{1,-1,-1,1},
{-1,-1,-1,1},{1,1,1,1}}; e=.1; r=3;
qt=Table[0, {i,9},{j,4}];
Do[qt[[i]]=pt[[i]].Tlf, {i,1,9}]; (* use Tlf for other image *)
Do[qt[[i,1]]=qt[[i,1]]/qt[[i,4]], {i,1,9}];
Do[qt[[i,2]]=qt[[i,2]]/qt[[i,4]], {i,1,9}];
ListPlot[Table[{qt[[i,1]], qt[[i,2]]},{i,1,9}],
PlotJoined->True, Axes->False]
Code for Figure 3.42.
Figure 3.43: Stereo Pair Shown as Complete Cubes.
Search WWH ::




Custom Search