ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° º º °Û°°°Û°°ÛÛÛÛÛ°°°ÛÛÛ°°°ÛÛÛÛÛ°°Û°°°Û°°ÛÛÛÛÛ°°Û°°°°° º º °Û°°°Û°°°°Û°°°°°Û°°Û°°°°Û°°°°Û°°°Û°°Û°°°Û°°Û°°°°° º º °Û°°°Û°°°°Û°°°°°ÛÛÛ°°°°°Û°°°°Û°°°Û°°ÛÛÛÛÛ°°Û°°°°° º º °°Û°Û°°°°°Û°°°°°Û°°Û°°°°Û°°°°Û°°°Û°°Û°°°Û°°Û°°°°° º º °°°Û°°°°ÛÛÛÛÛÛ°°Û°°Û°°°°Û°°°°ÛÛÛÛÛ°°Û°°°Û°°ÛÛÛÛÛ° º º °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° º º º º °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° º º °Û°°°Û°°°ÛÛ°°°ÛÛÛ°°°ÛÛÛ°°Û°°°°Û°°°°ÛÛÛ°°ÛÛÛ°°°°°° º º °ÛÛ°ÛÛ°°Û°°Û°°Û°°Û°°Û°°°°Û°°°°Û°°°°Û°°°°Û°°Û°°°°° º º °Û°Û°Û°°Û°°Û°°Û°°Û°°ÛÛ°°°Û°°°°Û°°°°ÛÛ°°°ÛÛÛ°°°°°° º º °Û°°°Û°°Û°°Û°°Û°°Û°°Û°°°°Û°°°°Û°°°°Û°°°°Û°°Û°°°°° º º °Û°°°Û°°°ÛÛ°°°ÛÛÛ°°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°Û°°Û°°°°° º º °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° º º º º Written by Chris Egerter (on November 24, 1993) º º Version 0.5á (Beta Version) º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ Reach me at: chris.egerter@homebase.com ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º T A B L E O F C O N T E N T S º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ What it is.........................Page 2 Why it was made....................Page 2 How to use it......................Page 3 Customizing Virtual Modeller.......Page 5 Future Additions...................Page 5 Credits and Greetings..............Page 5 P A G E 2 ÉÍÍÍÍÍÍÍÍÍÍÍÍÍ» º What is is: º ÈÍÍÍÍÍÍÍÍÍÍÍÍͼ Virtual Modeller is a 3D modelling program which allows you to design 3-dimensional objects and rotate them in real time animation on the screen. You require a VGA (or SVGA) card and monitor, and a Microsoft compatible mouse. For complex objects, a fast computer is needed, especially if you use a high quality rendering method (either Gouraud shading or texture mapped). ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º Why it was made: º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ Virtual Modeller was created for a number of reasons: 1. As an learning experience for me, to program 3D objects and rendering techniques. 2. To show off what my graphics library, The WordUp Graphics Toolkit, can do with only a few lines of source code. 3. To create interesting objects for title screens, presentations, etc. 4. To help others learn some techniques about 3D graphics (that is why the source is included) P A G E 3 ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ºHow to use it:º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍͼ To start, type vm <ÄÙ at the DOS prompt. A title screen similar to the header of this document will appear. Press any key to continue. You will then see the prompt - Enter the number of rotations: Enter a number, usually between 3 and 10. This will determine how many divisions the object will have. 3 will produce triangular objects, 4 will produce square objects, 5 will produce pentagonal objects, etc. The more divisions you make, the slower the object will be rotated. I recommend you try 3 or 4 rotations be begin with. There is a maximum number of rotations you can use, which is around 60 if you make an object with two points. The following prompt will then appear: Choose the type of polygons rendered: (W)ireframe (S)olid (G)ouraud Shaded (T)exture Mapped These options are ranked in order of their speed. Wireframe is the fastest mode to show objects in, and texture mapped is the slowest. Press the letter between the brackets to make your selection. (W, S, G, or T). * Wireframe shows objects using single lines. The object will be see-through. * Solid shows objects using solid polygons. This is the produces a fast animation and has half decent quality. * Gouraud shading shows shaded polygons, and has the best image quality. Speed of the animation slows down a considerable amount. * Texture mapping maps an image onto each polygon, giving it 'texture'. This is the slowest of all animation methods. If you choose this option, you will also see the following prompt: Should color 0 be see-through? (Y/N) If you choose yes, any portion of the texture map image that contain color 0, will be hollow. This allows for some interesting effects. After you've chose a rendering method, the screen will change into graphics mode, and the mouse will appear. This is where you get to design your own 3D objects. The modeller operates like a lathe. The left side of the screen is the center of the object. All points you select will be rotated around the center of the object, creating a solid, 3D object. P A G E 4 Here's an example object: Click on a point about a quarter of the screen away from the left edge. (with the left hand mouse button) Then click on a point about 4-5 inches away from that point. The second point should be on a diagonal from the first. A single line will be drawn between the two points. You may continue to click on more points and a line will be connected with the previous point selected, however for this example, click only two points. This will keep things simple for your first try. To view this object in a 3D animation, press the right hand button. This will rotate and render the object using the method you specified at the start. To quit the program press 'q'. To make another object, press any other key (besides 'q'). This will clear the screen and let you click on new points. You have to be on the animation screen in order to quit. If you are designing an object, press the right hand button first, and then press 'q'. To understand how the objects are created, run Virtual Modeller using 4 rotations. Place your left hand flat on your screen, with your thumb pointing to the right, and your hand flush with the left side of the screen. This is the plane in which you select your points. Now point your thumb towards you, and imagine the points coming at you. In other words, you're rotating the points by 90 degrees, which is given by the 4 rotations you chose. (360 divided by 4 = 90 degrees) Now rotate your hand so your thumb points to the left. You should be able to visualize how the object's vertices are attained. I wouldn't recommend rotating your hand for the fourth rotation since that might hurt! If you choose a higher number of rotations, the points would be rotated less than 90 degrees, and a rounder object will be produced. If your points start on the left side of the screen, you'll create a solid object. If they start towards the middle of the screen, you'll create an object with a hole in the middle. Another neat thing you'll probably try is 1 rotation. This means the points will only exist in a straight line, exactly as you click on them. This is makes it easy to write letters in script form. Some objects to try making are: dish, wine glass, cup and saucer, frisbee, screw, pencil, hubcap, torus, perfect sphere, thumb tack, pyramid, cone, cylinder. P A G E 5 ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º Customizing Virtual Modeller: º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ The texture map image is contained in the file "texture.pcx". You can use your favourite drawing program to make your own textures. It must be a 256 color image. In addition, the palette is stored in the file "vm.pal". This contains 768 bytes, or 256 byte triplets. Each byte must range from 0-63, and controls the Red, green, and blue values for each palette register. You can create this file from a number of drawing programs, including Autodesk's Animator (not the same as Animator Pro), the WGT Sprite Editor, and several other shareware/public domain utilities. If textured polygons are used, the palette from the PCX file is used instead. ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º Future Additions º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ The following are some ideas I may add to Virtual Modeller in the future: -Ability to load/save your objects -Screen capture during animation mode -Control rotations using the keyboard -A menu driven interface -Ability to adjust rendering method and number of rotations without leaving the program -Extrude function to create lettering and perfect cubes, etc. -Ability to show more than one object in animation mode -Better error checking for objects that are too large ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º Credits and Greetings: º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ The 3D routines used are from the WordUp Graphics Toolkit v4.0, which will be available near Christmas 1993 (hopefully). You will not be able to recompile the source code until this library is released. However, you can still get the general idea of what is going on and how the program was made. Virtual Modeller, and the 3D graphics routines are written completely by Chris Egerter. This program was written in one night, on November 24, 1993. Hopefully it will expand into a much larger program as time progresses. This means I need your suggestions! Send any E-mail regarding Virtual Modeller, the WordUp Graphics Toolkit, or any other matter, to: chris.egerter@homebase.com on the Internet. Shouts out go to: Steven Salter, Jordan Gallagher, Eric Webber, Kurt Pettersen, Vu Truong, Tom Yee, Felix Wu, Scott Deming, Steve Cox, Kenrick Mock, Wes Weimer, Rob Hopkins, Ron Lewis, Claude Marais, Eric Coolman, Mike Snow, Thomas Gerstner, Jim Logsdon, David Freeman, Adam Hall, John Butz, Greg Sommerville, Steven Kouri, and all my other friends.