Jump to content

Node placement helper


Recommended Posts

Hi all mod makers

This thread is designed to shed a little bit more light on node placement and orientation

nodehelper.jpg

In the diagram bottom left corner we see the Blender orientation arrows , but overlayed is what happens to the orientation in KSP.

All the co-ordinates in KSP expand out from the objects origin point in either positive or negative terms

If you sat in the pod above .. then X+ would be left side , Y+ would be up , and Z- would be forwards , now this isn't the normal orientation KSP expects so have a look at the part making tutorials if your not sure .

sample cfg entry--

// definition format is Position X, Position Y, Position Z, Up X, Up Y, Up Z

node_stack_top = 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1

This will place a node in the centre at the objects origin....

if we alter that to ...

node_stack_top = 1.0, 1.0, -1.0, 0.0, 1.0, 0.0, 1

This would place a node to the left by 1 unit , up by 1 unit and forwards by 1 unit(or rather minus 1), in relation to the vehicle pictured .

Most game assets would be oriented facing upwards along Y+

How to move the origin point about in Blender ... hit Alt+S , then select cursor to centre , or left click to position it anywhere you need it , now select the object in object mode , go to " object / transform / origin to 3D cursor "

Ctrl+A to apply any changes.

Anyone spot any holes in this shout up and i'll amend , anyone found themselves more confused after reading it then let me know :)

Edited by orson
Link to comment
Share on other sites

It all looks technically correct. You might want to write a small bit about UpX, UpY, and UpZ (the 2nd set of numbers in the node config) - basically tells the parts connecting to the node which direction should face "up"

in this case its correctly set to Postive Y, which is the top of the model. if you wanted it to attach upside down, then you'd specify Negative Y: X, Y, Z, 0, -1, 0, 1

Also, the 7th digit is the node size; it can be set to 0, 1 or 2, zero being the tiny half-meter sized nodes, and 2 being the big nodes for the new large parts.

One thing that might confuse some people is the orientation in the image above. If the windows are on the 'front" with the pilots sitting looking out of them, then in KSP its basically facing backwards as shown, with the windows facing the camera's default position. And it will work fine like that of course, especially with the ability to rotate parts at will.

Just for comparisons sake, in the stock 3man pod, the pilots lay back facing the top of the pod (+Y) with the tops of their heads facing -Z, and +X is on their right hand.

Link to comment
Share on other sites

anyone found themselves more confused after reading it then let me know :)
that would be me... :confused:

2 minutes later..

Ok after reading it a couple more times.. I got some questions.

If i would export something in blender that has the "front" pointing the wrong way, and I flip it in unity, will it still put the nods on the axis of the mesh? (i hope i made myself clear on that one)

and is there an easy way to copy/past coordinates from blender to the config file? , i mean like if i want it to be on the top of a model, can I meshure the units from the origin to the top in blender, and just write them on the cfg?

Link to comment
Share on other sites

Well KSP doesnt really care about the orientation of the model, it will put nodes at the exact coordinates you define in the config even if the mesh is 20 meters away. It only uses the origin or pivot point of the part as the 0,0,0 mark.

You can measure in Blender, as long as your scale is set to 1 meter. If you happen to have a single vertex in the exact place, you can hit N in Edit Mode and check the transform coordinates of that vertex and they will plugin right into your node:

y49ZG.png

Note on the upper left where it says Z: 1.000 - that is the postion of the vertex I have selected in the image (the one in the middle of the topcap, which is indeed at 0,0,1)

You must hit Ctrl+A to apply any rescaling and such to the object or the coordinates could be inaccurate (and the same applies to using the edge length measurement)

Speaking of that, if you don't happen to have a handy vertex right where you want a node, you can use edges to measure and get the info. Its in the same info panel, just scroll down and check "Numerics: Edge Length"

hVkrQ.png

Note that the edges I have selected are 1m long, so any node on the outside of the cylinder on the X or Z axis would have '1' as well, in this case its X so it would be: 1,1,0 (Y is still 1 as well, since we know the topcap is 1 meter from the center from the 1st example; You can also measure one of the side lengths as well to find that. They will be 2 meters long total, so 1 meter up and 1 meter down)

And a more advanced example:

vaSfm.png

This node would be on the edge of the top face, 45 degrees between the -X and +Y axis (+Y in blender, but remember Y and Z flip places when importing into KSP) so you get a node of -0.707, 1, 0.707

Of course all of the coordinates above are for the first set of node configs, so it would be:

node_stack_top = -0.707, 1, 0.707, 0, 1, 0, 1

which makes Y point up and sets the node size to 1.

You can also use trigonometry (specifically the Pythagorean theory and sine/cosine relations) to find nodes too. Those 0.707 nodes should look familiar to you if you have done much geometry... but that is a little beyond the scope of this topic.

Link to comment
Share on other sites

Trigormetry and pythorgararse theorum ? ... umm nope sorry i got a C in maths GCSE back in 85 lols running out on the last day shouting maths is for loosers ! ... who's laughing now tho , well not my math teacher he's probably dead :D

So im hoping when you said top left of the pic you meant top right in the properties pane ?

Whenever i used that method i end up with a crazy long number that has not worked so far in generating a useful co-ordinate .Perhaps i missed an important stage , still very novice with Blender .

It would help a lot if i knew where the figure originates ... is that the amount to the specific vertex from the origin ... or from the 3d cursor .... or from centre of screen ?

Edited by orson
Link to comment
Share on other sites

Yes sorry, top right properties pane. And that is a 3d coordinate for the vertex I have selected, where the origin of your mesh (sometimes called the pivot because the object is scaled/rotates around this point) is 0,0,0 Not the 3d cursor, or the SCENE origin, which is where the X, Y, Z coordinates (the colored lines) meet in Blender.

The numbers shown there can look weird, but keep in mind we're always working with "meters" as our unit for KSP.

So if it says something like "X: 87.0657432876" if you look all the way at the end of it, it probably says 'cm' which means its measured in centimeters. You just need to convert that to meters; You hardly ever need to go beyond 3 decimal places, so just divide that by 100 and you get: 0.871 after rounding up, and thus you have your X coordinate.

It might also be something like: Y: 0.000000031 cm

That of course is very very close to 0, so much so you should probably just erase the number and set it back to 0. Blender keeps track of very small amounts of difference for precision modeling, but such small measurements aren't too useful for KSP engine, so you can ignore them and round them to nice big numbers.

Link to comment
Share on other sites

So here's an improved version of Orson's original image, along with a ZIP file containing a XLS worksheet to convert from Blender Coordinates to KSP coordinates painlessly for you.

Blender_to_KSP_Co-Ordinates.png

I have it set up so that you can copy and paste from excel into the CFG file (with some massaging of it using the find/replace function to replace the white space tabs with nothing, then replacing "," with ", " and it ends up formatted correctly for the CFG file.

[ATTACH=CONFIG]34908[/ATTACH]

[ATTACH]34909[/ATTACH]

Edited by MKSheppard
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...