Jump to content

[Documentation] Wings creation mini tutorial


Justin Kerbice

Recommended Posts

How to create wings that's produce lift without scratching your head and keep your mood up

note: an off-line version is available here, the main feature is better page layout.

Introduction:

The only piece of information existing yet for wing is this post from EndlessWave:

+z is the direction of travel, +x is right, +y is the direction that's left (up in the SPH, 'back' in the VAB).

The part tools may ignore any orientation data on the object they're attached to, so ensure that is 0,0,0 and you only rotate child objects.

Which is quite not very obvious on all items KSP needs to make wing works (and the little tiny character mistake, a 'e' instead of a 'i' could be very confusing), as we can set-up a GameObject with Parttools component, add another dummy GameObject with it's own orientation as parent of the mesh, ...

Plus, it looks like to be wrong or just no longer applicable (post is from may 1st 2013) as you'll see later.

So after wasting/spending some time on make a wing works, I decide to make this little how-to to share the knowledge and make life easier for any other wing makers to come.

A look at some stock parts and lift:

Below you can see an important and helpful tool to see if your wings are correct, the center of lift tool show the lift direction (here the way doesn't matter, KSP doesn't take care of the way, I guess it's because the choice for symmetry which don't use mirror but 180° rotation* on forward, y, axis)

(for all pictures included: click on thumbnail to view the full sized picture)

eOn6rErs.png

Delta wing

aXVRbmVs.png

Swept wing

TlThVzms.png

even small winglet

*unfortunately, this mean there is no (easy) way to create downforce, or negative lift, for a racing car**.

** What ? Racing car in KSP ? Are you out of your mind ? "No... I just race, not rove like a snail" Jeb said.

Set-up your part to make a working wing:

For this tutorial, I've created the most simple wing: a mere box, flat and wide, it can't be simpler !

  • Create your own wing in whatever the modelling tool you use, pivot point here doesn't matter at all, but keep thing simple for unity import later, it looks like a good practice is to have the object centred on origin (0 on all axis), need to be confirmed.
  • Import the object into unity, be careful of the size (FBX file format are imported in 0.01 scale for example, I have not a single clue why it is this way), remove rig if no anim provided (from "legacy", default setting in unity editor 4.3.3 to "none"),
  • create an empty GameObject, move it to origin if it's not the first one (again, unity editor put all GameObjects into a random coordinates instead of origin !),
    yYSkPWSs.jpg
  • HERE is the important job: rotate the empty GameObject by -90°/270° on x axis in order to have its z axis UP (in blue in the picture below):
    QZCBQbNs.jpg
    (90° should do the job too, just +z will be down in this case)
  • THEN, an only THEN, put your object as child to this GameObject, as unity have trouble (again) with parent-child relationships, as soon as an empty GameObject get a child object, it's position and orientation become the one from the child, but rotating GameObject will rotate the child too (which is what we may expect).
  • You just need now to fill the KSP Parttools fields (name/location/...) and export,
  • create a config file* if not already done (not covered here, see many tutorials available),
  • load the game and enjoy seeing something like this:
    SncPT68s.png
  • As you can see on the picture above, lift is as expected and you can also notice the symmetry in action, wings have been put one side top and one side down for both left (source part) and right wings.
  • Finally you can now enjoy flying with your brand new wings:
    4D8P7F7s.png
    4D90h65s.png
    0AGvnAbs.png
    N5OHfGMs.png
    (parts use in these pictures comes also from my own sets like the tiny Xenon powered engine (available here)

* NOTE: wings don't use main part module but Winglet (module = Winglet in the top of the config file), see stock part for more details.

* NOTE 2: the origin (0, 0, 0) of the mesh (this means the unity GO too) is the location of the center of lift vector. If for any reason you want to shift the center of lift away, you'll have to move your wing object accordingly, for example to create lift on a point located below and close to the tip and/or the back of a wing.

You have also to be careful when creating pair of non symmetrical wings, both HAVE TO use the same origin or the plan you will build with them can have a weird behaviour.

Shapes and properties are not linked:

With stock game, whatever the shape is, the lift will be produced on the Z axis, any doubt about this statement, fine, look at the following pictures

IMP5lWYs.png

kYtmD99s.png

qsyvTgWs.png

ivlkBuvs.png

Convinced now ? :)

With a proper FAR config, and only in case a configuration file or a ModuleManager config is provided, FAR/NEAR won't change this that's much I guess, this worth a try.

Control surfaces ?

Control surfaces are not covered, yet, in this how-to, I may add later some text here if relevant, but it looks like Tiberion did a good job here.

Hope this have been helpful to you and save you a lot of time and troubles.

Included files:

template and default texture (Gimp format)

simple wings parts 1.0

Examples with texture included in the release:

RxyRD6os.png

1EwHjd0s.png

Edited by Justin Kerbice
add a note of center of lift/origin + a missing link
Link to comment
Share on other sites

This is great! The problem with most modding info is that it is buried in a thread or out of date. I have an idea to make a large community modding tutorial, with modders contributing their knowledge.

Link to comment
Share on other sites

Thanks Justin. Would you try to make a guide for FAR compatibility?

You're welcome. No, I think Taverius already did a great job, and it's with Blender (easier for you I guess).

I just start playing a bit with NEAR, but not really into it yet.

This is great! The problem with most modding info is that it is buried in a thread or out of date. I have an idea to make a large community modding tutorial, with modders contributing their knowledge.

Thanks, good luck to you :).

Link to comment
Share on other sites

  • 1 month later...
I've added this to the mod dev link list. Please make it 100% clear about all the orientation (like in the previous wing snippet) and I'll be able to remove the old link and just keep this.

What do you mean exactly ?

Can't make it more clearer than this, I guess :huh::

HERE is the important job: rotate the empty GameObject by -90°/270° on x axis in order to have its z axis UP (in blue in the picture below):
Link to comment
Share on other sites

  • 1 month later...

I'm sorry about my dumb posts in this thread. The information in that other link was actually wrong. No wonder my surfaces weren't working properly. You should delete that quote from EndlessWave. It contradicts what you said. +Z is up (or down), not direction of travel.

edit

If you want the arrows to appear correctly in the SPH then Z needs to point down in relation to the wing.

Edited by Cpt. Kipard
Link to comment
Share on other sites

I'm sorry about my dumb posts in this thread. The information in that other link was actually wrong. No wonder my surfaces weren't working properly. You should delete that quote from EndlessWave. It contradicts what you said. +Z is up (or down), not direction of travel.

edit

If you want the arrows to appear correctly in the SPH then Z needs to point down in relation to the wing.

:) it's not contradict what I wrote, it contradict the way things have been made by Squad in KSP.

The edit is more or less irrelevant as KSP, for now, use a 180° rotation on y axis to achieve the symmetry (which is very very bad and dumb ! Why ? Because we have to make both sides of wings identical, or use two separate objects to have bottom and top face in sync)

Link to comment
Share on other sites

I think Cpt. Kipard means that the quote should read:

"+z is the direction of lift, +x is right, +y is the direction of travel."

Which seems to be the case looking at your own work, and I agree should be changed (unless I'm misreading).

I'm still working on the symmetry thing, btw. I have yet to test with wings, but now I've got your tutorial to work from its much easier for me to play around. Thanks for taking the time to do this :)

Link to comment
Share on other sites

Can specify a noob question? if I make two different wings (for example the shuttle), should I change the direction of the axis, or can leave the same position of the axes for the two opposing wings?

Link to comment
Share on other sites

  • 4 months later...

Hi All - I'm still stuck. The best I'm able to do is get my wing attempts to have correct symmetry, but the lift vector points toward the middle of the craft. I've tried my best to follow Justin's directions, but I still get a wonky lift vector, and I lose symmetry. I'm very new to working with Blender and Unity, so I'm probably doing something totally obvious, but I've been using trial and error for hours and it's time to seek some help.

I start off in blender. To get symmetry, the trick I've learned is to rotate the local X-axis in Blender by 90 degrees. That gives me this (GLOBAL):

aQq6jLI.png

And this (LOCAL):

AzBAvqY.png

When I import into Unity, I get these:

Jro7v0G.png

8RrlwVW.png

Then, when I load into KSP, I get this outcome:

GYTZv6N.png

JpTQRx5.png

So I've got symmetry working the way I want, and the part is oriented the way I want, but no lift. Whenever I tweak it, I lose symmetry and the closest I've come on lift is downward lift.

I'm at a complete loss. Any ideas?

Link to comment
Share on other sites

gpd209: If i'm reading the OP correctly you have your axis wrong - see the picture under

HERE is the important job: rotate the empty GameObject by -90°/270° on x axis in order to have its z axis UP (in blue in the picture below):

It looks like the Z axis is the direction of lift - your screen shots show the X axis as the direction of lift.

Link to comment
Share on other sites

Yep. All that matters by the way is the mesh orientation in relation to your parttools empty. You can change the mesh orientation of the mesh object in blender if you want, but that's down to personal preference, and wont matter unless you do more advanced wings that have stack attachments or integrated control surfaces, where precise orientation really matters.

MODS

Is it possible to fix something in the OP? The orientation information at the top is wrong and keeps confusing people. I've already had a couple of beginners contact me about this.

Link to comment
Share on other sites

gpd209: If i'm reading the OP correctly you have your axis wrong - see the picture under ...

It looks like the Z axis is the direction of lift - your screen shots show the X axis as the direction of lift.

So I tried it with Z as the direction of lift and -Y as the direction of travel. I lost symmetry in KSP and, and lift is in the opposite direction of travel.

BmqYixY.png

ofiS6me.png

Link to comment
Share on other sites

and -Y as the direction of travel.

I wonder why, since no one told you to do that.

Should be -z is the direction of lift (can be "+" or "-" for the aero system, but "-" makes the arrow show up correctly), +x is right, +y is the direction of travel.

You also need to make sure your attach node is oriented correctly - I think.

Edited by Cpt. Kipard
Link to comment
Share on other sites

Cpt. Kipard - you were completely right: I needed to fix my attach node. I had failed to copy that over from the stock wing. Once I copied over the attach node into the config file, the wing's orientation to the lift vector was correct. I now have lift! Yay!

A million thanks to everybody for helping, esp. Cpt. Kipard.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...