Welcome To The Hyperspace Tunnel
Program Overview Webpage
I suggest that you understand 3D graphics before proceeding any further
I am currently 48 hours into creating a 3D computer graphics program that allows me to exactly duplicate the hyperspace tunnels as seen in the three Star Wars episodes in which they occur. The program does this by essentially creating a 3D cylinder that will be placed in 3D virtual space. One open end of the cylinder is located on the positive side of the view plane near the origin of virtual space. Located exactly at the origin of virtual space, in the Z=0 plane, is the view plane with its embedded viewport. It is the viewport that will ultimately contain the tunneling image that the user will view. The viewport has been oriented so that it looks down the positive Z axis towards the other end of the 3D cylinder. The 3D cylinder itself has been allowed to be positioned in virtual space so that views other than looking straight down the tunnel can be obtained. See the episode II picture above for an example of this. I capped off the far end of the 3D cylinder with a half sphere so I don't end up with a big black hole in my resulting images.
In order to create the image of a hyperspace tunnel, an extremely large painting called a texture map, must be painted or "applied" to the inner surface of the tunnel. Once the texture map is applied, the image of the tunnel in its current state can then be projected into the viewport and then saved to a file. In order to make the tunnel look like it is spinning and moving for each new frame of animation, the entire texture map must be conceptually moved either towards or away from the viewport by a certain number of pixels as well as rotated by a certain amount. Doing this procedure frame after frame will make it appear that the viewer is traveling down a rotating tunnel. I've determined that I'll make the tunnel spin completely around in three seconds and it will also translate forward or backward an equal distance in that time.
I've also incorporated a Scene Motion Blur feature into the program. This feature vastly increases the realism of the resulting animation sequence by bluring parts of the tunnel that are moving closer by the viewer. This is what would happen in reality since a certain amount of the tunnel will move past the viewer during each film frame. Adding this feature to the program will increase part of the program's execution time by up to 69 times, depending on how many sub-frames I have calculated for each frame. To view a nice webpage that reviews several types of motion blur click here
Creating a program to render the tunnel has proved to be straightforward enough, but creating the texture map to apply to the tunnel has been a pain in the butt. First, I wanted the resulting output images to be fairly high resolution so I can composite them with my eventual Star Destroyer model. Unfortunately, I can't support an image resolution to much above 800x340 pixels. This is unfortunate as I actually wanted to create the resulting output animation at a resolution of 2700x1149 pixels, but the memory requirements for this would have very easily exceeded the 4.2GB addressing limits of a 32 bit operating system. I eventually had to settle for an output image resolution of just 800x340 pixels. :( Even at that resolution, the program still required over half a gigabyte of RAM.
I have had many problems associated with creating a texture map of the required resolution, which is 5026x56580 pixels. So far I've spent over sixty hours working on texture maps and I have yet to produce a completely acceptable result. If I chose to create a physical texture map of the tunnel here in the real world, then I would have had to eventually get it into virtual space inside the computer where it can be rendered. To attain the necessary resolution, I would have had to create a texture map that would be 25" inches tall and 24 feet long! I would also have a lot of problems photographing such a thing. I would have had to photograph the texture map in many dozens of parts and then composite them back together in the computer to form the resulting texture map. This is not a trivial problem.
Then there is the question of what to put on the texture map. If I create a physical texture map, I will have to paint a b/w image onto this enormous canvas. It was also possible that I could come up with a programmatic way to automatically paint a texture map onto a virtual canvas in the computer using mathematical functions of one sort or another. The problem with this approach, in my opionion at least, is that a programmatic generation of the texture map won't have the organic, random feel to it that a hand painted texture map would.
I have also solved a problem dealing with edge discontinuities. In order to avoid seeing a visible seam when the two long sides of the texture map are joined together to form the tunnel cylinder, images running off one side of the texture map must seamlessly continue onto the other side of the texture map. The same goes for the top and bottom edges of the texture map as well. Edge continuity would have been a serious problem if I planned on painting a physical texture map in the real world, but this would not be a problem at all if I create the texture map in virtual space using a programmatic approach.
As you can see, both the physical and programmatic approaches to creating the tunnel texture map have their own advantages and disadvantages. What I've decided to do is combine both of these approaches into a hybrid design. With this approach, I choose to use the advantages of each approach and simply discard all the disadvantages of each. I'm currently in the process of making a physical texture map.
Last Updated: May 3, 2002
HTML URL: http://geocities.datacellar.net/~special_effect/ht_program_overview.html
E-Mail: special_effect.geo@yahoo.com or click here