User Tools

Site Tools


ofp:modeling:brsseb_lesson6

Lesson 6: Creating your first Airplane

Creating your first Airplane by Brsseb

Preparing for the lesson

Yes, now im back and its finally time for airplanes! First things first..you need these skills and programs to do this tutorial:

  • OFP (daahhh), O2 and Bulldozer
  • Basic understanding of the O2 interface
  • Having fully understood stuff from lesson1 (like creating LODs, selections etc)
  • Note that it says “lesson”, not tutorial. That means that the info in this lesson, which is nr 6, I assume that you have learned some stuff from the other lessons. You must have done at least 3-4 of the previous lessons to get something out of this.
  • PBOTool and TexView or similar program

There is already a good Airplane tutorial on the net (Building the Piper Cheyenne). Its not done yet and it focuses on modeling an airplane from start to finish (from blueprint setup to final model). In my tut, which will be a abit shorter, I will focus just on the LOD (and config) setup needed to get an airplane model working properly in OFP.

Ok, lets move to next page and have a look at the tutorial model…(drumroll…)

The tutorial model

Ok, i know that if you have followed the other tutorials, you know that I don't make proper models for my tuts. I make them as simple as possible so that its easier to see i.e important vertex placements on my screen shots (hard to understand a 3d mesh view with 2000+faces in the background…) and for the fact that I don't want to use too much time on simple example models. So here it is, in all its glory:

pmc.editing.wiki_images_brsseb_brsseb_lesson6_b_1.jpg The model we will we working with in this tutorial

First thing you must do is download the model.You can get the ZIP Brsseb_lesson6_start.rar from bottom of this page.

As usual, extract the ZIP and put the folder you get in your bulldozer directory just as any other addon project. The folder is called “firstplane”. The p3d is also called “firstplane”, then there is a config.cpp file and some basic textures.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_b_2.jpg Fire Geometry and Geometry LOD looks like this

Since we have learned many things by now, I have made the most obvious things on the model. Here Fire Geo and Geo are the same (just that Geo has wheight, of course). On a real project, Fire geometry would usually be mode detailed.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_b_3.jpg Landcontact contains just 3 vertices making up the trycycle landinggear

The landContact LOD contains just 3 vertices, each repersenting the though point for the wheels. We will have to change this one later for the gear to work properly, though.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_b_4.jpg Nothing new in memory LOD yet, just the basics of any vehicle

And then the Memory LOD, containing things that you learned ages ago, right? Hope so.

So, so lets not go into o2 just yet. I want to show you what we need to do. The easiest way to explain the work needed; I want to you to compile the firsplane now. Yes, test it ingame and see what we need to do! Start your PBO program, compile the firstplane folder and put the resulting pbo in your addons folder. Yes it will fly! (but dont use the firstperson view for the pilot/cargo, since the View Pilot/Cargo LODs are not made yet, we`ll do that last (since we will be editing the original “0.00” LOD all the way).

pmc.editing.wiki_images_brsseb_brsseb_lesson6_b_5.jpg

pmc.editing.wiki_images_brsseb_brsseb_lesson6_b_6.jpg The plane it its current state. Not very plane-ish, am I right? Note that the landinggear dont retract, the rotors dont spin and there are no control surfaces (flaps, rudder, ailerons) present. Dont worry, we`ll fix all that!

Ok, so not much to brag about is it? No working gear animation, the rotors don't spin or anything. And there are no working flaps, rudder or ailerons to see. But it can take off, land, and it flies very well. That's due to the config file, and we can make ANYTHING fly with just the right configfile. So no magic really.

Ready to fix the plane? Then start up o2 and bulldozer and move to the next step.

Making the landing gear work

Lets fix the landing gear first. If you tested the model ingame, you will notice that the Raise/Lower landing gear at the action menu works. Trying to land the plane without gear down, you will crash. So that's not the problem, that's all defined in the config. What we need to do is make the animation for our gear work so that the gear in the plane retracts and lowers when the user uses the aciton menu.

How do we do that, you say? If you have followed my tuts you know it by now: we set up a bunch of wacky named (in czech) selections and let the ofp engine do the rest. We have a tricycle landing gear (one nose gear and two at the rear), just like the ofp A10 got. So ofp will have no problem with this.

  • Start o2 and head for the “0.00” lod. Using F2 selection, select the left rear wheel, like in picture. Name this one “levy kolo” (left wheel)

pmc.editing.wiki_images_brsseb_brsseb_lesson6_c_1.jpg

  • For the opposite gear, select it and name it “pravy kolo”.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_c_2.jpg

  • Then select the front gear and name it “predni kolo” (front wheel, or nose wheel).

pmc.editing.wiki_images_brsseb_brsseb_lesson6_c_3.jpg

Ok, now ofp know what the gears are and will use these selection when doing the rotation. But we still have work to do, we need to define an axis for each wheel, so that ofp can rotate each wheel around. Lets go to memory lod for that:

  • In memory lod, make an horizontal axis on top of the left landing gear. See picture. Name it “osa leveho kolo” (axis for the left wheel). You should already be comfortable with making axises, if not see how me made the steering wheel in lesson 2.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_c_4.jpg

  • Make a similar axis for the right wheel. Name it “osa praveho kola”.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_c_5.jpg

  • For the front wheel, same thing. Name that axis “osa predniho kola” (seeing a pathern here?).

pmc.editing.wiki_images_brsseb_brsseb_lesson6_c_6.jpg

Ok, so now OFP can do the gear animation with no problems. One thing remains though:

  • Go to Landcontact LOD and select the vertex beneath the nose gear. Name it “predni kolo” (front gear). Then select the right and then the left gear and name them “pravy kolo” (right gear) and “levy kolo” (left gear ). See picture for full details:

pmc.editing.wiki_images_brsseb_brsseb_lesson6_c_7.jpg This way the LandContact points follow the gear animation

Guess what, if you have checked that all selections are named right and you have followed this page to the point, the gear should work now. So compile and lets test the gear ingame. If some of the gears don't work, its probably because a bad named selection. Make sure you got no typos on the plane. And should some animation work the wrong way, try rotating the axis 180 degrees in Memory LOD.

Note that we cant seem to control the direction the gear retracts. They always retract forward, like the A10 does, and sometimes that's not what we want (e.i. most ww2 fighter retracted their gear inwards). So if we want to have a different gear animation, we can (from v1.85+ at least). But this is out of scope for this simple tutorial.

ok, now lets see if we can do anything about the static rotors. Lets make them spin!

Fixing the rotors

Lets make the rotors turn. The LOD setup for that is similar to the one from lesson 4, where we made teh rotor blades spin. We need some selections in 0.00 lod and some axises in Memory lod. Note that we have two engines on this plane, so if you just have one engine, you just use the first set of selections.

Note that both engines has a rotor structure and a face with a rotor blur on it. Lets begin.

  • Go to 0.00 LOD and zoom in on the left engine.
  • Select (F2) the blurred face, the rotor (all 4 blades), the spinner and the axis structure on the left engine. Name them “vrtule 0” (the zero behind indicating the rotor it belongs to)

pmc.editing.wiki_images_brsseb_brsseb_lesson6_d_1.jpg

  • Then select only the left rotor blur plane and name it “vrtule 0 textura”.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_d_2.jpg

  • Ok, now zoom in on the right engine. Do exactly the same thing as the two steps above, but this time with “1” instead of “0” for the selection names (“vrtule 1” and “vrtule 1 textura”). Simple really.
  • When you have all four selections, select both image planes for the engines. Name them “vrtule blur”.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_d_3.jpg

  • Then select the 4 rotor blades on BOTH engines (not the image planes or any of the spinners or axises), name all eight structures (blades) “vrtule staticka”.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_d_4.jpg

Ok, done with the rotors in model lod. Lets head for Memory LOD and make the axises for the spinning rotors.

  • Go to memory LOD and make two axises, one for each rotor (2 vertices each). They should be named “osa vrtule 0” (left) and “osa vrtule 1” (right). See the picture for proper placement.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_d_5.jpg

And that's that. Compile and see how it looks ingame. Make sure you got all the selections correct or you might get some strange results.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_d_6.jpg Plane with working rotors. Nice!

If you only had like 1 rotor, you simply do the same setup without the one engine included, and that way you could also leave out the “0” in all selections that have that.

Now, how about fixing those control surfaces, eh?

Control surfaces

Lets make one type of control surface at a time and then compile and test to see if it works.

The rudder

We`ll start with the rudder. As you can see we need only one rudder surface, since we have only one vertical tailfin. We must make the surface, give it a selection name and an axis.

  • Make a box-structure in the shape of the missing rudder. Then texture it with the “black.pac” file in the firstplane folder. You should be able to do that easily by now. When you`re done, name it “leva smerovka” (left rudder. If we had two vertical tail fins, the other one would be named “prava smerovka”).

pmc.editing.wiki_images_brsseb_brsseb_lesson6_e_1.jpg

Go to memory LOD and create an axis for the rudder. Name it “osa leve smerovky” (axis left rudder)

pmc.editing.wiki_images_brsseb_brsseb_lesson6_e_2.jpg

Now lets compile and see if it works. I assume you know how rudder should work (which way it turns when you turn the plane). If not, consult any flight simulator or check out the official planes. The problem when making axises for plane surfaces, is that the order the vertices in the axis is created matters! So sometimes you might end up with a surface, like the rudder, going the wrong way or spinning around like crazy. If the rudder is reversed when you compile now, simply swap the axis vertices position to fix it (that way you have rotated the axis 180* and it should now work). The axis swapping need is a common problem with plane makers, so be prepared to swap some axis points if the problem occurs.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_e_3.jpg How the rudder should work. If it is reversed, try swapping the two axis points

The most common problem with plane surfaces is Typos, its so damn easy to make a mistake when typing the selection names (much due to the words left and right in Czech has different forms; levy (left); leve, leva, and pravy; (right) prave, prava, etc. So make sure you get all of the selection names right!

The elevator surfaces

Go to 0.00 lod and make the two missing elevator surfaces. (place a box-structure, resize and make them black like before). Then select each of them and name them “leva vejskovka” (left) and “prava vejskovka” (right). Note that its “pravA/levA”, with A instead of “Y” on the end. That's the most common Typos there is in plane making, thrust me! Make sure to get the right form on all words!

pmc.editing.wiki_images_brsseb_brsseb_lesson6_e_4.jpg

  • Then head for memory LOD and make two axises for the surfaces. Name them “osa leve vejskovky” (left) and “osa prave vejskovky” (right).

pmc.editing.wiki_images_brsseb_brsseb_lesson6_e_5.jpg

Now compile and test it ingame. Remember to swap (switch places) on axis vertices if one of the elevators go the wrong way when testing. If you are unsure, compare to another plane or try thinking of what happens when a surface moves.

The ailerons

The next surfaces are the ailerons, they make the plane roll to the side. Also, in ofp, ailerons is also used for air brakes. We want air brakes too, so these surfaces are somewhat different.

Go to 0.00 lod and make the ailerons. But this time, make a total of 4 structures, not just one pair as before. Remember the air brake on the A10? Of not, test it now and try to imagine how they did it. Basically, they have slitted each aileron surface in two, so that when normal flying it works just as a normal ailerons, but when you brake (holding the back-key long enough), they split parts, with one part going up and one down to form the air brakes. Pretty neat, really.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_e_6.jpg Here is a setup for air brakes from another model of mine. Just to show you how it all works. Don't worry, I`ll walk you trough the whole selection naming

So lets do this:

  • Make one of the aileron surfaces using a black box as you before, but this time make it just half as deep as you should have it (or half as thin).

pmc.editing.wiki_images_brsseb_brsseb_lesson6_e_7.jpg

  • Then copy the structure and place the copy directly below the original one in side view. (Both of them selected on picture (and moved abit more down to fit the whole better)

pmc.editing.wiki_images_brsseb_brsseb_lesson6_e_8.jpg

  • Ok, now do the same thing for the other surface (just copy this one will do).

Now you have two ailerons, one right and one left both split on two halves. Now we must create proper selections for them.

  • Select the left upper aileron structure and name it “lkh klapka” (that's left upper aileron part). Then select the left lower structure and name it “lkd klapka”. That does it for the left aileron.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_e_9.jpg

  • Select the right upper aileron structure and name it “pkh klapka” (thats right upper aileron part). Then select the right lower structure and name it “pkd klapka”. Now the right aileron is done.
  • Ok, now go to Memory LOD and lets do the axises. Make one axis for each alerion (just two axises in total, you don't need one axis per part!). Name them “osa lk klapky” (left) and “osa pk klapky” (right).

pmc.editing.wiki_images_brsseb_brsseb_lesson6_e_10.jpg

Phew, now that was a bit hard, now wasn't it? Test it and correct with axis swapping or typo hunt if you screwed up. Make sure you get it right: When a plane bank (roll) to the left, the one on your left goes up and the one on the right goes down (seen from the back). And vice versa. Also, test the air brake feature: when you hold down the back-button for some time, the ailerons should split and the top pair goes up (+90 degrees up) and the bottom pair goes down (-90 degrees down). Compare with the A10 if you are still unsure.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_e_11.jpg Here showing how ailerons with air brakes work

The flaps

One surface type left: the flaps, used for either giving the plane extra lift at takeoffs of for reducing airspeed at landings. Dead easy for you to make now if you have made it so far.

  • Make the flaps structures, one for each side. Make them black as usual. Name the left one “ls klapka” and the right one “ps klapka”.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_e_12.jpg

  • Now make the two axis in Memory lod, one for each flap. Name the left one “osa ls klapky” and the right one “osa ps klapky”.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_e_13.jpg

Now test the flaps ingame. Operate them using the action menu and make sure they move the right way. if not, you know what to do don't you ;)?

pmc.editing.wiki_images_brsseb_brsseb_lesson6_e_14.jpg Flaps in the up and down positions

Ok, still alive? Good, because we are all done with control surfaces! So now they work, the propeller spins and the gear retracts. Great job! On the next page we`ll add some more detail, and then its all done!

Adding detail

We got a nice plane right now, but we can still add some minor details to spice it up a bit. So lets add some features: If you did lesson 5, the boat tutorial, you know that lights are easy to make. We just add some named vertices in Memory lOD. So lets have red and green position lights on the wingtips and a flashing white one at the top of the tail, like most planes do (Or go mad and decorate the plane with lights like a crazy christmas three, your choice ;) ). And a bunch of other smaller details.

  • Open the firstplane.p3d again go to memory LOD.
  • and insert some vertices on the plane like on picture. Same setup as for the gunboat in lesson 5.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_f_1.jpg

  • As for the gunboat, you can also control where the engine smoke is to come out from. Not very important, but nice gadget feature anyway. You place one vertex named “vyfuk start” (vyfuk is the smoke) and one named “vyfuk konec”. Doesn't seem like its possible to have a pair of these (since we have two engines), so I just placed them on the left engine.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_f_2.jpg

  • Furthermore, you can specify directly where the wheel dust is to take place (!). Its by placing a vertex directly beneath the wheels in Memory LOD. We`ll place the pair for the rear set if wheels. The vertex on the left is called “levy prach” and right is called “pravy prach”.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_f_3.jpg

  • Would be nice to have some spotlights for night landing, right? Sure it would. We haven't modeled spotlights on our model, but never mind. We`ll do spotlights anyway. In memory LOD, place four vertices like this at the lower front. Name them as in image. This will create two spotlights that can be turned on or off at night. Makes taxiing easier ;)

pmc.editing.wiki_images_brsseb_brsseb_lesson6_f_4.jpg

OK, that's enough detail for now, isn't it? One last thing…

The Configfile

As usual, I give a short overview of the configfile. Im not teaching C++, so don't ask me about what classes are or such questions. If you don't have a CLUE on what this config does, you need to hook up with someone who knows if you want your addon in the game.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_g_1.jpg Part 1 of the configfile

In the first part, we have the usual declarations, the CfgPatches class and where out model is introduced to the game for the first time, and the CfgModel class where we specify which type of addon this will be and what subclasses we need.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_g_2.jpg Part 2 of the configfile

The last part is the interesting one. Here, the usual stuff about any vehicles are defined. Many of the values in here should be familiar to you now (model, side, displayname). Note the value “gearRetracting=true” indicating that this plane has retracting gear, like the A10 does. The Cessna haven't. Then there is a lot of physics values that can be tweaked for the plane, like brake distance and control surface sensitivity. Note that no weapons are on board the plane right now (that's for another tutorial, for sure ;) ).

OK, bored now? Me too, lets compile and get this thing over with!

Finish line

OK lets get this over with quickly. The last thing to do is to make the “View Pilot” and “View Cargo” LODs, just like you did in lesson 4 and lesson 5. Easy, just right click “0.00” LOD, select duplicate twice. Change the two new LOD copies to View Pilot and View Cargo. Now the messed up 1st person view for the pilot is no more!. See lesson 4 (helitut) for more in deep info about view-lods.

pmc.editing.wiki_images_brsseb_brsseb_lesson6_h_1.jpg pmc.editing.wiki_images_brsseb_brsseb_lesson6_h_2.jpg The plane ingame! Pretty nice, huh?

Get final PBO Brsseb_lesson6_end.rar below.

So compile the plane for the last time, and check it out ingame. If all works as planned, feel proud. If not, try again, make yourself 200% sure that you don't have any typos or anything. If everything fails (or you spotted a bug in this tutorial, mail me at brsseb@hotmail.com).

Thanks for all nice feedback Ive gotten so far since Ive started this tutorial series! I`ll try to write as often as I can. Cheers!

BRSSEB

Download OFP.Brsseb_Lesson/ Torrent Magnet from below:

magnet:?xt=urn:btih:40aac3407210ddb8ffcee06cdb009c0b099ccdce&xt=urn:btmh:122046986f756bcebf9744dc9f81bc3fc736a54e164113ec62e18c827a4a06271364&dn=OFP.Brsseb_Lesson&tr=udp%3a%2f%2ftracker.opentrackr.org%3a1337%2fannounce&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a6969%2fannounce

Notes

This tutorial was written by Brsseb in ofp.gamepark.cz/_hosted/brsseb/, it was posted here with his permissions, thank you Brsseb!

ofp/modeling/brsseb_lesson6.txt · Last modified: 2024-03-19 06:51 by snakeman