Reference / Paper · 2004
Peak of Flight #123: How to Add Decals and Decoration to your RockSim Designs
Apogee Components' Peak of Flight newsletter, issue 123 (2004).
- peak-of-flight
- apogee-components
- model-rocketry
Reference / Paper · 2004
Apogee Components' Peak of Flight newsletter, issue 123 (2004).
Apogee Components' Peak of Flight newsletter, issue 123 (2004).
N I S S U E 1 2 3 , A P R . E S W L E 9 , T 2 0 0 4 T E R How To Add Decals and Decoration To Your RockSim Designs 1130 Elkton Drive, Suite A Colorado Springs, CO 80907 USA www.ApogeeRockets.com orders @ApogeeRockets.com phone 719-535-9335 fax 719-534-9050 Page 1 ISSUE 123 - APRIL 9, 2004 P E A K O F F L I G H T Adding Decals To The 3D View In RockSim 7 By Tim Van Milligan {Note: This article covers how to add decal images to your RockSim design using RockSim v7.04. Newer versions of RockSim will be different from these instructions.} In RockSim v7.04, we turned on a hidden feature that we had hoped to announce a long time ago. That feature is the ability to add decoration (like decals) to the 3D image, such as the one shown on the cover of this issue of the Peak-ofFlight newsletter. The reason we didn’t turn it on sooner was that there wasn’t an easy-to-use interface that allows users to control to positioning of the decal images. We’ll be adding that sometime in RockSim v8. We decided to turn it on at this time because it has been requested so many times. In other words, people want to see what their rocket would look like when it was painted and decorated. Because there isn’t a specific user interface yet to control the location of the decals, the feature is by default in the “off” mode. If it was in the “on” mode, people would be more confused about some strange fields that appear in the edit menus. That can be confusing. So I’m going to tell you how to turn the feature on, and how to place some simple decals on your rocket. First, let me say that there are some things you need to know about this feature. In technical terms, it is actually called “Texture mapping.” The texture is an image that is applied to the surface of the rocket. Texture mapping is a complicated science, and is very graphics intensive. You’re taking a flat image, and distorting its shape to fit the curature of the rocket. This isn’t so easy... Figure 1: The RockSimSettings.dat file is stored in the RockSim root folder. A P O G E E Page 2 In other words, it will slow down the performance of RockSim. You’ll really notice it when you try to rotate the rocket while it is in 3D mode. Also, if you have RockSim in 3D mode while running a simulation, you’ll also see it really slow down. Therefore, when you are designing the rocket, or running simulations, try to keep it in 2D mode (or Base View mode) to limit the performance issues. Step 1: Turn On The Texture Feature You only need to performce this step just once. In other words, you don’t need to turn it on for each rocket design yo are working on. Once it is on, it is on for any design you open. To turn it on, you actually have to open up the XML file that controls the user settings. The name of this file is “RockSimSettings.dat”, and you’ll find it in the RockSim folder on your hard drive (see Figure 1). Important: Before you open this file, make sure Rocksim is NOT running. RockSim uses this file to store your user preferences (like fonts, colors, units, etc), and it will overwrite any changes you may make. You open this file using any text editor program, such as Continued on Page 3. Figure 2: Find the <EnableTexture> line, and change the “0” to a “1”. R O C K E T S ISSUE 123 - APRIL 9, 2004 P E A K O F Adding Decals Continued From Page 2 MS Word, or WordPad. Use the search feature of the program to find the phrase “Options.” You’ll see something like shown in Figure 2. Find the line in the <Options> section that says: <EnableTexture>0</EnableTexture> and change the “0” to a “1.” This turns on the feature. If the line does not exist in the file, you simple type it in. But make sure the line is after the <Options> line, and before the </Options> line After you have made this change, do a “Save As,” and save the file in the same folder location using the same file name: RockSimSetttings.dat. Make sure you save it in TEXT ONLY format.. FYI: If you are afraid of messing something up, don’t worry. You can always delete the entire file from your computer by dragging it into the Recycle bin. When RockSim starts F L I G H T up, it automatically regenerates this file. It will default to the original factory settings, so you’ll need to reset your favorite units, colors, fonts, etc. But you really can’t mess it up. Step 2: Start RockSim We’re now ready to start adding decoration to our rocket designs. As mentioned previously, you should probably wait until after you have completed the design before adding the textures (decals) to the rocket. Otherwise RockSim begins to run really slow. Find a part you want to add a decal to. In my case, I chose the external body tube on a the FATBOY.rkt file. Edit the body tube part, and click on the “DRAWING” tab. Note: You can add decals to ANY part in the rocket, nose cones, body tubes, fins, transitions, etc. You’ll see a new text field labeled: “Texture” as shown in figure 3. If you don’t see it, then you haven’t successfully saved the RockSimSettings.dat file. So quit RockSim, and go back to step number 1. Before you start adding the decal to the part, you should change the basic color of the part to white. Why white? Because RockSim will combine the colors of the decal and the base colors. When combined, you’ll get a completely new color. So start with white, and that way your decal colors will stay as you planned. Step 3: Find Your Decal Artwork Figure 3: Once you turn on the Texture feature, you’ll find a “Texture” field on the drawing tab of each part. I’m assuming you already have decal artwork. If not, you’ll either need to find some, or create some. The file format that RockSim will accept is .jpg, .bmp, or .png. These are allstandard picture formats, so you can easily create them with a drawing program like Adobe Photoshop, Illustrator (my personal favorite), or some other type of image editing software. As it says about in the heading for this step, our task is to “find” the file that contains the artwork. More importantly, we need to find the exact file path so that RockSim can find the artwork. If RockSim can’t find the file, it can’t put it onto the rocket. Where the file is located is not important. Only you must know the file path to get to that image. How do you find the file path? Continued on Page 4. About this Newsletter You can subscribe “FREE” to receive this e-zine at the Apogee Components web site (www.ApogeeRockets.com), or sending an email to: [email protected] with "SUBSCRIBE" as the subject line of the message. A P O G E E R O C K E T S PAGE 2 Page 3 ISSUE 123 - APRIL 9, 2004 P E A K O F F L I G H T Adding Decals Continued From Page 3 I know a lot of people that use RockSim are new to computers, and may not know what a file path is. So I’ll show you how to find it on your computer. Start my minimizing RockSim, so you can display the desktop and the folders. Now pretend like you sorta know where the file is located on your computer, and start opening folders until you find the name of the file you want RockSim to see. But don’t open it. Using the “RIGHT SIDE” button on your computer’s mouse, ‘right-click’ on the file name. This will bring up a little menu as shown in Figure 4. From that menu, select “PROPERTIES.” Once you make that selection, you’ll get a new dialog screen like the one shown in Figure 5. Note the line that says “Location:”. It displays the exact file path to get to the image file you want. You can either write this information down on a piece of paper, or you can highlight it and do a “copy” command (Control key + C key). Figure 5: Write down the exact file path location to your decal image file. We’re going to take this File Path information, and put it into the “Texture” field of RockSim. IMPORTANT: Before you type in the file path information into the “Texture” field, start by typing: File= Then type in the rest of the file path information. Without “File=” you won’t get the image displayed on your rocket. In my example, I had an image called “Apogee.jpg” that I wanted to use. It was stored in a folder called “Texture Samples”, which was in my RockSim folder. My particular text field has: File=C:/Program Files/Apogee/RockSim7.04/ Texture Samples/Apogee.jpg Your file location will be different — depending on where it is located on your harddrive. If you did a “copy” from the Properties Dialog box, you can now do a “paste” which is easier than typing it in from scratch. To do a paste, simply use the keystrokes “CNTRL + V.” Make sure to have “File=” before you do the paste. Figure 4: ‘Right-Click’ on the file name, and select properties. A P O G E E Page 4 Continued on Page 5. R O C K E T S ISSUE 123 - APRIL 9, 2004 P E A K O F F L I G H T Adding Decals Continued From Page 4 Figure 7: The decal is now on the rocket. Figure 6: Type the word “File=” and then the exact file path for the image into the “Texture” field. Also, change the part color to white. Step 4: Wow That Was Simple! tube. Another way to adjust the decal is to change the image file itself, using an external editor program, like Adobe Photoshop, Illustrator, or Corel Draw. You can change the size, Continued on Page 6. Just click the 3D button in the image window, and if you have the file-path correct, your decal will now be placed on the rocket! See Figure 7. If you get no decal image on the part, the cause is that you have the incorrect file path typed into the Texture field, or that you forgot to put the words “File=” at the start of the box. Once you get the decal displayed on a tube, you might try putting them on other parts too. You can put them on the rocket’s nose cone, or the fins, as shown in Figure 8. You’re probably wondering, why is this process of typing in the field path so complicated. The answer is that this is the part of the user interface that isn’t complete yet. When the software gets revised, this step will be much, much simpler. It will be as easy as opening up a file using a browser window. Step 5: Adjusting The Decal’s Size and Position Once the decal is displayed on the rocket, you have some limited control in how it is postitioned. For example, in Figure 7, the decal is partially covered by the root edge of the fin. You can move the fins off the decal by changing the radial position of the fins, or adjusting the radial orientation of the A P O G E E Figure 8: You can also put decals on fins. R O C K E T S Page 5 ISSUE 123 - APRIL 9, 2004 P E A K O F F L I G H T Adding Decals Continued From Page 5 the orientation or the background color to match the rest of the rocket. I would recommend this as a first step, as you’ll feel you have more control over the image as it is displayed on the rocket. From within RockSim itself, there is some limited ability to control the size and position of the decal on the rocket. This is done with the use of a modifying in the “Texture” field, as shown in Figure 9. Figure 10: The same decal as in Figure 8, but this time with image modifiers turned on. Default=0,0,0 Controls the translation of the texture map. Figure 9: By using modifiers after the file-path, you can control how the image is displayed. I’ll give you an example of what the field will look like once you use image modifier commands. File=C:/Program Files/Apogee/ RockSim7.04/Texture Samples/ Apogee.jpg|Scale=2,2,1|Repeat=0 The modifiers is the text after the file path name. In this case, it is: |Scale=2,2,1|Repeat=0 This tells RockSim to reduce the size of the image, and not to tile it on the part if it isn’t big enough to file the entire piece. Compare Figure 8 to what the image looks like with the modifiers turned on, as shown in Figure 10. Here is a list of the modifing parameters that you can use to change the appearance of your decals. Don’t be afraid to try them. Origin=r,s,t Default=0.5,0.5,0.5 This is the point around which map rotates Scale=r,s,t Default=1,1,1 Scales the texture map. FlipR=0 or 1 Default=0 Indicates whether to flip texture around r-axis FlipS=0 or 1 Default=0 Indicates whether to flip texture around s-axis FlipT= 0 or 1 Default=0 Indicates whether to flip texture around t-axis Repeat=0 or 1 Default=1 Turn on/off the repetition of the texture map when the texture coords extend beyond the [0,1] range. Interpolate=0 or 1 Default=1 Turn on/off linear interpolation of the texture map when rendering. Position=r,s,t Continued on Page 7. A P O G E E Page 6 R O C K E T S ISSUE 123 - APRIL 9, 2004 P E A K O F Adding Decals Continued From Page 6 PreventSeam=0 or 1 Default=1 Controls how the texture coordinates are generated. If PreventSeam is set, the s-coordinate ranges from 0->1 and 1->0 corresponding to the angle variation from 0>180 and 180->0. Otherwise, the s-coordinate ranges from 0->1 from 0->360 degrees. General Notes about the modifying parameters: 1. Texture coordinates (r,s,t) are in the range 0...1. 2. The scale and position factors are relative to texture coordinate space. 3. Attempting to use textures in design mode is not recommended. Each time the 3D rendering is refreshed, the texture files must be read from disk again. 4. Texture files should have height and width values that are multiples of 2 for optimal performance. Example: 128 X 128 , 512 X 1024 , Etc. This is a requirement of OpenGL. Any texture maps that do not conform to this rule will be scaled at display time. This can distort the image, and cause the rendering to be slower. Helpful Hints Displaying the decal image on the rocket is the easy part. Modifying its size or changing its position is a bit more com- F L I G H T plicated. Part of the reason is because there isn’t a user interface built into RockSim v7.04 yet that was specifically designed to handle this task. As we release future versions of Rocksim, this should be much easier. Because of this, at the current time, I personally found it easier to modify the existing .jpg image outside of RockSim first. But I’ll leave it up to you to experiment. As you may have noticed in the illustrations, when RockSim displays a decal that includes words, sometimes they can get flipped or wrap around the rocket in a weird way. While you’ll notice that “words” can get goofy looking, if you are working with geometric shapes, this can be adventageous. You’ll find that things like stripes, roll patterns, and textures (like wood grain) do display quite well. Overall, I’m sure you’ll have a lot of fun adding decals to your rocket using RockSim. It can be addicting to play with. And feel free to send me a screen shot, or a link to your web site where you’ve posted your designs that have decals on them. I’d like to share with other people the cool things you can do with RockSim. About the Author: Tim Van Milligan is the owner of Apogee Components (http://www.apogeerockets.com) and the curator of the rocketry education web site: http://www.apogeerockets.com/education. He is also the author of the books: “Model Rocket Design and Construction,” “69 Simple Science Fair Projects with Model Rockets: Aeronautics” and publisher of the FREE e-zine newsletter about model rockets. You can subscribe to the e-zine at the Apogee Components web site, or sending an email to: [email protected] with “SUBSCRIBE” as the subject line of the message. Figure 11: These are the artwork files that I used as decals on the rocket displayed on the front cover. Geometric patterns, like the ones in the top row are easy to make, and work great. A P O G E E R O C K E T S Page 7