Jump to content

Rotating attachment nodes


Recommended Posts

 

Yep, in the part CFG, each attachment node has 6 or 7 values. The first three are its location, and the second three are a vector direction. The last (optional) value is just the size of the attachment node's snap-sphere in the VAB/SPH.

 

So you just need to change the vector orientation in the 4th through 6th numbers for the node. If you're turning it 90 degrees, it'll be as a simple as putting a 1 or -1 for either X or Z, and setting Y to 0. If it's a more complex angle, you might have to do some math.

 

Link to comment
Share on other sites

Yes I realized that the last three digits (excluding the size) was for orientation, but I never figured out how to rotate a node by 10 degrees, or something even more complicated like 3.4 degrees. Unfortunately for me, math is not my strong suite, as I can barely figure out what 2+2 is :)

May I ask how I would "math" my way to rotating the nodes? Is there an example somewhere on how to do this?

Link to comment
Share on other sites

 

Unfortunately, it's a little bit of trig. The good news is you're working with a circle of radius "1", so the math is pretty simple.

 

Let's say you have a node that's "0, -1, 0" so it's aligned along the Y axis, and you want to rotate it 10 degrees into the X axis.  If you pull up the Windows calculator, it has a mode for doing sine and cosine in degrees, so we can skip converting from degrees to radians.

 

So basically, you just need:

 

X = cos(a)

Y = sin(a)

 

With "a" normally being "90" or "270" degrees for up or down, respectively, so just add or subtract the rotation from that. For instance, if it's a bottom node, and you're rotating 10 degrees, it might be:

 

X = cos(280) = 0.173648

Y = sin(280) = -0.984808

(rounded to the 6th decimal place)

 

 

 

Link to comment
Share on other sites

2 minutes ago, NecroBones said:

 

Unfortunately, it's a little bit of trig. Let's say you have a node that's "0, 1, 0" so it's aligned along the Y axis, and you want to rotate it 10 degrees into the X axis. The good news is you're working with a circle of radius "1", so the math is pretty simple.

 

If you pull up the Windows calculator, it has a mode for doing sine and cosine in degrees, so we can skip converting from degrees to radians.

 

So basically, you just need:

 

X = cos(a)

Y = sin(a)

 

With "a" normally being "90" or "270" degrees for up or down, respectively, so just add or subtract the rotation from that. For instance, if it's a bottom node, and you're rotating 10 degrees, it might be:

 

X = cos(280) = 0.173648

Y = sin(280) = -0.98481

(rounded to the 6th decimal place)

 

 

 

Thank you, this really helps a lot. :) Appreciate you taking the time explaining it.

Link to comment
Share on other sites

1 minute ago, NecroBones said:

 

No problem, glad to help! Looks like you quoted me while I was editing for clarity too. ;)

Oops, my bad. Guess I got a bit too excited there :) Been struggeling with trying to figure this for a few days now, so glad to have an answer.

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...