BaldEagle Tools - LODEditor

Home      LODEditor       Theater Building Utilities       Models

 

LODEditor Help & Tutorials

LOD Editor Tutorial

Importing 3DS Files

By

Rick "Dragon" Prior

 

Introduction:

With some of the latest functions within recent releases of LE, the ability to take a 3ds file and convert to LOD format is becoming the preferred option for creating new aircraft. I have done this in several cases with very nice results. As much of you may disagree with me, it is a relatively painless task that can be done in a few evenings.

This tutorial will walk through the steps required to successfully import a 3ds for use within Falcon. Due to the fact that Fred's PC version of LE is growing into it's own program, I wont go into exact details since my Mac version does things differently in some cases. However, you will be able to do all the tasks regardless of which version you are using.

Please make sure you have the latest version of LE. Much of our focus recently has been on automating many of the time consuming tasks. Heck, I am sure that by the time you read this, there will be new functions to make it even easier!

 

3ds File:

The first task you will have to do is obtain a suitable 3ds file to import. There are several ways you can do this. First, you can make it yourself! I have no clue how simple this is and would never venture to do it myself. Second, you can use one that is already made by someone else. There is a lot of talent within F4LE so maybe you can get someone to make you a model. Also, there are many good resources on the web where you can download already completed models. Some of these are free yet others are for a fee. Depending on how important the project is, maybe you could get a group together to split the cost for a high quality model (just a thought!). Some things to consider when choosing a 3ds file:

Poly Count: This is extremely important! The F16 within Falcon has a count of something like 1600. I don't see ANY reason why you would want to go much higher than that. Keep in mind that the higher the poly count, the more work you have in doing the conversion! From what I have seen, you can have a nicely detailed model in the 300-600 poly count range which is easy to manage.

Details: It is not necessary to have all the added details in the 3ds file itself. When talking about details I am referring to landing gear, lights, afterburner, etc. Those can be easily added by means of the Block functions.

Textures: Although it would be helpful to have the model completely textured before the import, it is not extremely necessary. The texMapper functions can map a model within an hour so don't let a nice model go by just because it lacks texturing.

Poly Order: The import will bring the nodes in based on the order the polys are within the 3ds file. I have seen models where the polys were grouped nicely and thus makes the conversion go quick. However, I have worked on many models where the polys are scattered all about. This means more work for you so if you are making the 3ds file, try to keep the order consistent! NOTE: I am working on methods to group polys to make life easier!

 

Import 3ds:

After you have found a 3ds file you want to convert, you must load it into LE. When you do this, you will be given options as to what type of nodes to import as. I suggest you choose the type that has vertice colors and shaders. This will give you the most uniform shading within the game. Also, most models end up containing 90% in this mode and the other 10% in single shader mode.

Save the imported file someplace and give it a number in the name. As you work on the model, save after each major task with a new number. This way, if you screw something up (or LE goes south on you), you have something to go back to.

 

Optimize:

First thing to do is run the VerifyModel function and optimize the model. Most of the 3ds files will import with HUGH vector tables! When verifyModel is run, you may see a long list of duplicate vectors. Go ahead and reassign them. When that is complete, you should now see a long list of Unused Vectors. What happened was LE went though the nodes and changed all the duplicate vector references to point to a common vector. That leaves a bunch of unused ones. Go ahead and remove the unused vectors. In a few I have done, I was able to remove 70% of the vectors doing this!

 

Position:

Once the model is optimized, you may need to position the model. I have seen some 3ds files come in upside down, or facing to the left, or even rotated at 45 degrees! Use the rotate functions within the vector screens to get the model in the right position. This is a very good time to save your model BEFORE you do these! Knowing which direction to rotate can be sort of trial and error. NOTE: If there are Subtree branches within the model, you will have to do the same to those so write down what values you use so you can keep everything consistent.

 

Branching:

Ignore colors, shading, etc for now. The first thing we want to do is break up the nodes into branches. This is the most time consuming part of the process and can be tedious at times. However, there are many nice features within LE that make this easier and I am sure more are to come. There is no right way to do this. Just find a way that doesn't overload your brain. I prefer to use a combination of BreakBranch function and Cut/Insert.

Turn on Labels so you can see where the node is (vertex numbers). Now look at the model and determine how you want to group the branches. You can start out with large branches that you can further sub-divide later so don't get too detailed at this point. I would suggest you break them up something like this: tail, fuselage, canopy, right wing, left wing, right elevator, left elevator, etc. For the fuselage, it may need to be branched out further. Examples: twin exhausts, dorsal fins, etc.

Start at Node#1 and notice where it is. Now go to Node#2. If it is in the same group, keep going down the list until you reach a node that is within a different group. Go up one node (last node of the first group) and choose BreakBranch function. This will put a Split node at 1 and put all those nodes within its branch. You have now made a branch that is isolated from the other nodes.

Now, go down to the first node past the branch (this will be a node that is not indented at all). This position will ALWAYS be the next node to look at! See what group it might be located within and continue going down the list. Again, when you reach an end, break the branch. If you are lucky, the nodes will be nicely grouped so you can zip through the model quickly breaking branches of 50-100 nodes at a time!

BUT, life is not that easy so you most likely will end up doing the cut/insert option as well. What you need to do is select a node, cut it to the clipboard, move to the branch you want it in, and insert it there. This can be time consuming but there are many ways to help this. You can cut nodes to the clipboard one at a time. That is, scroll down cutting nodes in the same group then inserting them all at once. Either way you do it, you need to get them all branched out before you go on to other tasks.

 

Structure:

The next task is to structure the model with Split nodes to solve look thru bugs. Although this task can go fairly quickly, it is probably the hardest to understand. Trust me though, after you do a few, you will get quite good at it!

I suggest you grab a piece of paper and look at your model on the screen. Try to spot where you might have look thru bugs. A look thru bug is a case where you have two nodes that can be visible from the same viewing angle AND be in front of one another. If you picture a Sphere made up of a bunch of polygons. Yes, there are more than one poly that can be viewed from any angle BUT, never can any two viewable polys be in front or behind another! In this case, you do NOT need any splits. Same goes for a cube or a rectangular cube.

Now, take a cube and attach a smaller cube to one side. If you were to look straight down on it, there would be no look thrus. BUT, if you were to look down at an angle from the large cube side, you could "look thru" the large cube and "see" the top surface of the small cube. This is a potential look thru bug if the large cube draws before the small cube.

Lets solve the look thru issue with the two cubes. Start by putting a split after the root. Make the split plane cut between the two cubes and point towards the large cube. Lets assume you have the large cube on the left and the small cube on the right (in top view). The split would be:

nx = -1

ny = 0

nz = 0

nS = x location of interface of cubes

The '-1' in the nx field points to the left. So the split would read like this: "Am I looking at the model from the left side?". If the answer is YES, then we need to draw the small cube first since it is in the back. Then draw the large cube since it will cover up the small cube and thus nothing will look thru. The structure would look like this:

Root

Split (-X)

Small cube

Large cube

If we would view the model from the right, it would draw the large cube first followed by the small cube. I suggest you read the tutorial on Splits and understand it well as it will help you out.

Now, lets try to structure a simple airplane model. Lets assume it is something like a MiG-21. This model has the following distinct features:

Elevators, wings, canopy, nose cone, afterburner, gear, tail, wingtip lights, slots, dorsal fin and fuselage.

Comments: First, the fuselage is relative simple in geometry and doesn't have any look thru issues. You will get look thru issues if the model has engine intakes on either side, twin exhausts, gaps or spaces, etc. Second, the nose cone has some polys that face forward that could look thru the cone section. Third, the slots, gear and dorsal fin are all on the bottom and could look thru each other.

Ok, now you have a good understanding of what your potential look thru issues are. Lets begin by splitting the model up in big chunks:

Root

Split

Tail

Remainder

The easiest first thing to do is split on the top of the fuselage. This will break apart the tail from the rest of the model. If you split in the +Z direction (looking UP) then you can put the tail section in the first split branch.

Now, we must split the rest out. Usually, I will split the wings off the fuselage next (which is what the original LODs usually do also). Ignore the Tail portion and lets look at the "Remainder" portion:

"Remainder"

Split (+Y)

y- wing

Split (+Y)

fuselage

y+ wing

Here, we split by looking from the +Y side which means we want to draw the opposite side first (Y- wing). Then we split again from the +Y side to split off the other wing. Put it all together and you get this:

Root

Split (z+)

Tail

Split (y+)

y- wing

Split (y+)

fuselage

y+ wing

Now, we have to further break up each section. Lets look at the wings. These wings consist of the wing itself, lights, slots and gear. The lights go on the wingtip and the slots and gear go on the bottom. So I would split in the Y direction to separate the main wing from the lights. Then when drawing the wing, I would split in the Z direction to split out the wing and the stuff that goes under the wing. When drawing under the wing, I would split in the Y direction to split out the slots and gear. So a wing structure would look like this:

"Wing"

Split (Y)

Lights

Main Wing

Now, lets break up the Main Wing:

"Main Wing"

Split (Z)

Wing

Underwing

Now the Underwing:

"Underwing"

Split (Y)

Slot

Split (Y)

Slot

Gear

Now, lets combine them all into the Wing structure:

"Wing"

Split (Y)

Lights

Split (Z)

Wing

Split (Y)

Slot

Split (Y)

Slot

Gear

Now lets put both wing structures into the main structure:

Root

Split (z+)

Tail

Split (y+)

Split (y+)

y- Lights

Split (z+)

y- Wing

Split (y+)

y- Slot

Split (y+)

y- Slot

y- Gear

Split (y+)

fuselage

Split (y-)

y+ Lights

Split (z+)

y+ Wing

Split (y-)

y+ Slot

Split (y-)

y+ Slot

y+ Gear

Finally, we have to structure out the fuselage. In this case, the features of the fuselage are: afterburner, exhaust, body, canopy, dorsal fin, gear and nose. The easiest way to do it is to break out the bottom first. This gives us:

"Fuselage"

Split (z-)

Bottom

Main fuselage

The bottom consists of the dorsal fin and landing gear but could also have underbody slots as well. Split these out in the X direction:

"Bottom"

Split (x+)

Dorsal fin

Nose gear

Now for the main fuselage. Here, we split looking down to get the canopy and then we split in the X direction to separate out the other parts:

"Main Fuselage"

Split (z+)

Canopy

Split (x+)

Afterburner

Split (x+)

Body

Nose

The only problem with this is the exhaust. That is the dark inverted cone at the back end of the fuselage. It will look through the back end of the fuselage if you don't control the order. One way to fix it is to put those draw nodes at the very beginning of the "Body" group. This way the outside surfaces will cover up any potential look thrus. You could also put it has the chPtr branch of the Split before the Body. That means it will ALWAYS draw before the Body no matter which view you are in.

So if we put all the segments together, we get:

Root

Split (z+)

Tail

Split (y+)

Split (y+)

y- Lights

Split (z+)

y- Wing

Split (y+)

y- Slot

Split (y+)

y- Slot

y- Gear

Split (y+)

Split (z-)

Split (x+)

Dorsal fin

Nose gear

Split (z+)

Canopy

Split (x+)

Afterburner

Split (x+)

Exhaust

Body

Nose

Split (y-)

y+ Lights

Split (z+)

y+ Wing

Split (y-)

y+ Slot

Split (y-)

y+ Slot

y+ Gear

Now, you have a structure and you also have nicely grouped branches! Now it is just a matter of Copy/Paste to set it all up. Start by placing a Split off the nxPtr of the Root node and then pasting the tail within the Ptr1 branch. Continue on thru the structure until it is complete.

As a final step, you should turn fill mode on and go into EyeView mode. Now take a good look at your model to see if you have any look thrus. Make sure you look at all different angles and fix any look thru issues you may have. Usually, you run across something you didn't see at the start that you will have to fix.

 

Switches/DOF's:

Now that the structure is all complete, you need to set up the switches and DOF's. The switches are simple in that all you have to do is put a Switch node at the start of the branch and give it the proper number. DOF's can be a little more difficult and I expect better utilities in this area in the future.

For DOF's, you first must convert the branch into a DOF branch, then orient the object properly in raw form, and finally position it on the model.

To convert to DOF, simply highlight the branch you want to convert and choose ConvertToDOF function. This will create a DOF node for you and set up the vectors. It will attempt to place the object at ZERO in the raw state and set up the DOF matrix to bring it back to it's original location.

Once you have the branch converted to DOF, you then need to go into DOF Edit mode and orient the object so it rotates about the X axis. You do this by bringing up the DOF vector table and using the Rotate options. When you attempt to rotate a DOF table, it will prompt you to update the matrix. You should say "YES" to this prompt! NOTE: There are many differences between the Mac and PC versions on how we handle the DOF tables. If you are having problems doing these tasks on the PC version, notify Fred.

After you have it oriented properly, you need to then set the DOF matrix translation values to put it in the proper location. When you have it done, you can use the DOF animate functions to make sure you have it all set up properly.

 

Added Details:

If your 3ds model didn't have gear or other details, you can use the Block functions to copy them from another model and insert into your new model. Just make sure you have the structure right when you add these details.

 

Textures:

If your model had textures associated with it, you will need to update the texture numbers. If the model did not have textures, you will have to create them.

The Root node contains the texture table. If your 3ds file had textures included within it, you would have seen a list of textures during the import process. This is the order in which you need to put the textures. If our example model had 2 textures, you might have seen this during import:

Textures:

0 body.bmp

1 wings.bmp

This is the order in which you will set up the Root node texture table. If you were to look at the root node texture table, you would see there are 2 textures and they are numbered 0 and 1. What you need to do now is append or insert the two textures (body.bmp and wings.bmp) to your data files. Lets say the values are 1302 and 1303. This means you must update the Root node texture table to have 1302 and 1303.

Be careful when inserting blocks from other models! If you insert a landing gear block, it most likely will be using the Tire texture. This means that the draw nodes for the tire will have a texture reference. You should check this to see what it is. If it is '2', then you are OK in that it will not interfere with your current textures. In this case, add another texture which becomes '2' (remember, 0 is the first one). Now make '2' equal texture #21 which is for the tire. If the reference number in the draw nodes is 0 or 1, then you have a conflict. In this case, you should change the references to the next usable texture reference. This can be done by opening each node and changing the value or by using the Node Changer function (highlight the nodes you want to change first).

Lets assume that our landing gear is using reference '2'. This means that our Root node texture table would look like this:

1302

1303

21

 

Clean Up:

Now that your model looks correct, we need to do a little house cleaning. Run verify model and reassign any duplicate vectors, remove any unused, and fix any other errors that may be present.

When you have that all clean, run AutoShader. This will automatically calculate all the shading normals for the entire model.

 

Texture Mapping:

When texture mapping, there is two ways to go about it. First way is to map to an existing texture or secondly, to map to an empty texture that you will create later. In either case, you should have the texture references for all the nodes pointing to the proper numbers.

 

Mapping an Existing Texture:

Lets say you already have a texture you want to apply to the model. What you need to do is look at the texture and notice the groupings. It might have a side view of the fuselage, top and bottom views of the wings and elevators, engine intake, etc. Lets walk through mapping the fuselage.

The texture has a side view of the fuselage. There is only one side so you will want to map both sides of your model to the same area in the texture. To do this, you will need to highlight all the nodes that make up the fuselage. You can do this by going to start of the fuselage section and selecting the Block. Again, there are many ways to select nodes and they vary between the Mac and PC so I will leave it up to you to get the fuselage selected. NOTE: You want to grab them all! Don't miss a node. To get a perfect transition, you want to grab them all the pertain that particular side view.

Once you have the nodes selected, choose TextureMapper function. When this comes up, make sure you have the proper texture chosen from the menu. Then, click either LEFT or RIGHT button. It really doesn't matter which side you choose as you can use the mirror function to flip it over. After you click the button, you will see the mapping of the side of the fuselage on the texture. Now, it is a matter of fitting it on top of the texture.

Again, the interface is slightly different from the Mac to PC so I wont go into detail here. Basically, you will want to move the mapping into position, size it using the scale buttons, rotate if necessary, stretch, distort, whatever to get it to best fit.

If you have to move an individual point, make CERTAIN you have the LOCK checkbox ON! When you have it the way you want, click APPLY and close the textureMapper.

Now, select another section of the model to map. This time, maybe one of the wings. Highlight the wing and bring up the mapper. Choose the proper texture and click TOP to map the top of the wing. Again, move and adjust to fit the texture.

Continue to do this until the entire model is mapped out.

 

Mapping a New Texture:

In some cases, you may not have a texture to map. For this, you want to create a mapping that can be used as an outline to make the texture. For this, you do pretty much the same except you wont be distorting or anything. Here, you must decide on how many textures you want and what will go on them.

I usually start with the biggest items like the fuselage. When I hit the MAP button and get the mappings, I click HIDE to not display whatever texture is under it. Now position the mapping on the blank texture and hit apply.

On the next group you map, click HIDE again but this time also click ALL. This will show all your previous mappings in black. Position the new mapping somewhere next to the previous one. Keep doing this until you are done or the texture is filled up.

When you have everything mapped out, take a screen shot of the blank texture with all the mappings. Send these screenshots to someone good with graphics so they can make the textures from the mappings.