for k=0:2
x0=((3*col)/(2*pi))*cos((2*pi*(k*col+j))/(3*col));
y0=((3*col)/(2*pi))*sin((2*pi*(k*col+j))/(3*col));
z0=row-i+1;
[perspective or orthographic procedure goes here]
end
The For Loop has k taking on values 0, 1, and 2 in order to produce the three copies of the image.
Alter one of the programs perspective.m or orthographic.m to produce a "helical band" similar to Figure 1. The pixels along the bottom row of copies of the input image are to be positioned along the helix initially parameterized by , , and , where r and m have to be suitably chosen. Start by re-parameterizing the helix by arc length. Then decide how many revolutions you want there to be (say ), and figure out what values of r and m will yield, in that many revolutions, an arc length equal to n times the number of columns of the input image. It may help to assume , but this ratio determining the slope of the helix can be adjusted. For simplicity, each column of pixels is to be sent to a vertical line segment starting at a point of the helix. It is a good idea to use variables such as n, r, m, and rev in the program so their values can easily be altered. Also, rather than having 19 separate sections of code in the program for the 19 copies of the input image, it works well to use a For Loop letting an index k take values from 0 to n-1.
The Torus
Alter one of the programs perspective.m or orthographic.m to produce a torus as in Figure 4. Twenty copies of an input image that is about 50% taller than it is wide are used in that figure, but you should feel free to experiment with other choices. Let's think of a torus as a surface obtained by rotating about the z-axis a circle of radius r whose center C is in the xy-plane R units from the z-axis (with ). Let's assume that the dimensions of the input image are row by col, and we intend to wrap the torus with what amounts to a 2 by 10 array of copies of the image. Then it may work well to require and . Note that as the center C is rotated about the z-axis, it produces a circle of radius R that can be parameterized by , , and . Also, t can be assigned equally spaced values from 0 to 2, and, for each value of t, the point is the center of a circle of radius r along which we want to position a column of pixels. The unit normal and binormal vectors of the parameterized R-circle offer a handy way to find the coordinates of the points on these r-circles.