How to Use mk-cyl2.pl The Perl script mk-cyl2.pl generates a texture-mapped VRML cylinder from a series of panoramic photographs. In theory it can join sets of photographs shot with the camera at different elevations; in practice, the algorithm needs work and may generate distorted images. mk-cyl2.pl takes a data file on STDIN and generates VRML 1.0 on STDOUT. The following is an example datafile: Title Minoru Park Description View of Minoru Park, Richmond BC showing the duck pond Latlong 49D10.2N 123D8.9W Facets 10 Y1 -20 Y2 20 Level 0 n0.jpg 20,239 20,0 289,0 319,239 n2.jpg 45,239 45,0 291,0 291,239 n4.jpg 51,239 51,0 300,0 300,239 grey.gif 44,239 44,0 319,0 319,239 grey.gif 44,239 44,0 319,0 319,239 Level -1 nd0.jpg 40,239 30,51 298,51 290,239 nd2.jpg 90,225 59,43 297,53 287,239 nd4.jpg 99,227 59,46 309,56 300,239 grey.gif 73,225 48,48 314,48 304,48 grey.gif 73,225 48,48 314,48 304,48 Commands: Title - (optional) - the title of the scene Description - (optional) - a description Latlong - (optional) - the Latitude/Longitude of the scene origin Facets - If there are N images, the cylinder is made of N panels each with N facets. Strictly, it is a regular polygonal prism. More facets makes for a smoother result but a larger file and increased rendering time. Y1, Y2 - The observer defaults to (0,0,0). The level 0 cylinder extends from Y1 metres to Y2 metres in height. The radius is determined from the image sizes. Level - 0 corresponds to a set of photographs shot with the camera horizontal. Level 1 corresponds to the next set up (with the camera elevated) Level -1 corresponds to the next set down (with the camera depressed) Images: x1,y1 x2,y2 x3,y3 x4,y4 (x1,y1) gives the bottom left corner pixel co-ordinates (x2,y2) gives top left, (x3,y3) gives top right, (x4,y4) gives bottom right. How to use the program: First, take a series of photographs using a camera on a tripod. A digital still camera will do nicely. With a digital video camera, you can just swing the camera in a circle and figure it out later. Otherwise, take a series of shots which overlap. The more they overlap, the better the quality will be but the more work is required. Then, determine the pixel co-ordinates of the matching points on each image. It is probably worth cropping the images first so that the remaining overlap is quite small. Using a tripod, hopefully the Y co-ordinates all match up. If not, more work is involved. One can use a tool such as Mark Podlipec's xv (unix), or Thomas Boutell's mapedit to determine co-ordinates. Two copies can be run simultaneously. If more than one level is used, four copies may make things easier. These co-ordinates are entered in the datafile such that, if you cut the images out with scissors, you could join them together. When the program runs it determines the total image size using ImageMagick "convert" (which handles JPEG, and probably PNG). Some inline code (commented out) can determine GIF sizes directly. If the images were cropped, they will not be all the same size. The pixel co-ordinates are scaled by the image size to give fractional co-ordinates. A determination is made of the total circumference of the cylinder by summing the widths of the images. If some images are missing, a dummy image may be used instead to give correct results (grey.gif in the example). The height is determined from the average height of the images. Each image is mapped to a faceted panel using the VRML TextureCoordinate2 node. Note that some viewers (including most Windows ones) are restricted in the size of texture file that can be rendered. The free viewer VRweb apparantly does not have this limitation (at least on Unix). This means that to get good resolution, you may need to tile the images. The program may be extended to do this at some future time. The program generates a set of arbitrary viewpoints North, South, East, West which may be edited later to match the actual orientation. Andrew Daviel, andrew (at) Vancouver-Webpages (dot) com, November 1996 http://Vancouver-Webpages.com/vrml/ determine pixels