CaptainKipard Posted October 3, 2014 Share Posted October 3, 2014 (edited) My wings need angled stack nodes. It has to be pointing -X and +Z, 6.763 degrees up from horizontal.How do I math? Edited October 4, 2014 by Cpt. Kipard Quote Link to comment Share on other sites More sharing options...
Porkjet Posted October 3, 2014 Share Posted October 3, 2014 (edited) I recently had the same problem, and taverius pointed me to this:Not sure its helpful for your odd numbered angle, I'm a maths dummy so that's all I can contribute Edited October 3, 2014 by Porkjet Quote Link to comment Share on other sites More sharing options...
CaptainKipard Posted October 3, 2014 Author Share Posted October 3, 2014 Thanks. That's good reference but it's only for those angles.I've been trying to google, but I'm getting confused results. The KSP wiki says that a 45 degree angle angle should be written as [1,1], but then people say I should be using cos and sin on the angle which doesn't give those same results. Quote Link to comment Share on other sites More sharing options...
cxg2827 Posted October 3, 2014 Share Posted October 3, 2014 (edited) x=cos(angle)y=sin(angle)make sure calculator knows its reading the angle in degrees, not radians. Edited October 3, 2014 by cxg2827 I'm a dummy Quote Link to comment Share on other sites More sharing options...
CaptainKipard Posted October 3, 2014 Author Share Posted October 3, 2014 x=arccos(angle)y=arcsin(angle)make sure calculator knows its reading the angle in degrees, not radians.That's giving me errors.Just for clarity I'm doing cos-1(45) Quote Link to comment Share on other sites More sharing options...
OrbitusII Posted October 3, 2014 Share Posted October 3, 2014 (edited) You can't do arcsin or arccos with an angle, it's used for finding the angle of a normalized vector (magnitude=1). This graphic may help:If sin(alpha) = O/H, then alpha = arcsin(O/H) where A is X and O is Y (or the other way around if you wish) and H is the resultant vectorThe former can be used to easily find O or H, but the latter is used almost exclusively to find alpha (the angle you're using as a reference point) Edited October 3, 2014 by OrbitusII Why did that graphic use alpha instead of theta??? Quote Link to comment Share on other sites More sharing options...
cxg2827 Posted October 3, 2014 Share Posted October 3, 2014 if you set the hypotenus to 1, you get:x=0.993y=0.1178if you want to have x equal 1:x=1y=0.1186 Quote Link to comment Share on other sites More sharing options...
cxg2827 Posted October 3, 2014 Share Posted October 3, 2014 You can't do arcsin or arccos with an angle, it's used for finding the angle of a normalized vector (magnitude=1). whoops, you are right Quote Link to comment Share on other sites More sharing options...
CaptainKipard Posted October 3, 2014 Author Share Posted October 3, 2014 I'm even more confused now that I was before....... Quote Link to comment Share on other sites More sharing options...
cxg2827 Posted October 3, 2014 Share Posted October 3, 2014 The KSP wiki says that a 45 degree angle angle should be written as [1,1], but then people say I should be using cos and sin on the angle which doesn't give those same results.i think the magnitude of the x and y vectors for the nodes do not matter. As long as it gets 45 degrees, it could care less about the magnitude of the vectors.2,21,10.5,0.5will all net you 45 degrees Quote Link to comment Share on other sites More sharing options...
nli2work Posted October 3, 2014 Share Posted October 3, 2014 (edited) I'm even more confused now that I was before.......basically they're sayingcos(6.763)=Xsin(6.763)=Y (or Z in your case I think)just make sure calculator knows 6.763 is degrees, not radians Edited October 3, 2014 by nli2work Quote Link to comment Share on other sites More sharing options...
OrbitusII Posted October 3, 2014 Share Posted October 3, 2014 (edited) Picture again:If you want the attachment axis to be 6.763 degrees off of +X, just take the sine of 6.763 for the Y-axis (O in the picture) and the cosine of 6.763 for the X-axis (A in the picture). Make sure your calculator is using degrees and not radians because then you'll end up with a totally different result.This works because when using a Hypotenuse length of 1, the equation sin(alpha) = Y/H simplifies down to sin(alpha) = Y, giving you the Y-component of the triangle. The same can be done for cosine and the X-component of the triangle. These components can then be combined to create the vector (X,Y), which can be represented by the Hypotenuse of the triangle.If you haven't taken any trigonometry courses (Pre-Calc, Calculus) I would strongly recommend it. People might say that math is useless, but they're wrong. Edited October 3, 2014 by OrbitusII Quote Link to comment Share on other sites More sharing options...
CaptainKipard Posted October 3, 2014 Author Share Posted October 3, 2014 Ok I think I can make it work now.If you haven't taken any trigonometry courses (Pre-Calc, Calculus) I would strongly recommend it. People might say that math is useless, but they're wrong.I did take calculus a looong time ago. I failed it, partly because the teacher didn't explain it in a way that's easy to understand or practical. If you know of any sources (preferably video) that explain trigonometry and calculus like to a moron, then I'd like to look at it. Quote Link to comment Share on other sites More sharing options...
OrbitusII Posted October 3, 2014 Share Posted October 3, 2014 I don't know of any resources besides Khan Academy off the top of my head, but KA is free and supposedly quite good. I can't advocate for it myself since I took AP Calc with a phenomenal teacher (the son of Donald Knuth, if anyone knows who that is) and I'm innately wired for math, but it's better than nothing.Link to The Trigonometry Page Quote Link to comment Share on other sites More sharing options...
NoMrBond Posted October 3, 2014 Share Posted October 3, 2014 (edited) Did the NODE{} config calls get fixed?Herp, I should check my parts which use NODE{} and see if they're the right size now, brb.[Edit] Put empties where you want (and pointed where you want) the connection nodes, then use NODE{} in the config to use those empties as your attach nodesExample pic[Edit3] Make sure your transform names are correct though (sorry opened the wrong model for that config). In game screen of part using NODE{} Edited October 3, 2014 by NoMrBond Quote Link to comment Share on other sites More sharing options...
CaptainKipard Posted October 3, 2014 Author Share Posted October 3, 2014 (edited) Wow. I wish I had known about this weeks ago. It would save so much effort. I'll try it. I guess I should be using fixed_joint. What's the correct orientation in Unity. Edited October 3, 2014 by Cpt. Kipard Quote Link to comment Share on other sites More sharing options...
nli2work Posted October 3, 2014 Share Posted October 3, 2014 Did the NODE{} config calls get fixed?Herp, I should check my parts which use NODE{} and see if they're the right size now, brb.[Edit] Put empties where you want (and pointed where you want) the connection nodes, then use NODE{} in the config to use those empties as your attach nodesExample pichttp://i.imgur.com/MLyjb2e.png[Edit3] Make sure your transform names are correct though (sorry opened the wrong model for that config). In game screen of part using NODE{}I vaguely remember something about these, but never see any configs using it... whats the difference between Hinge and fixed joints? Quote Link to comment Share on other sites More sharing options...
NoMrBond Posted October 3, 2014 Share Posted October 3, 2014 (edited) Wow. I wish I had known about this weeks ago. It would save so much effort. I'll try it. I guess I should be using fixed_joint. What's the correct orientation in Unity.Sorry about that, I couldn't remember if it had been fixed or not (all NODE sizes used to come out in-game as size=0 (0.625) which was badddd news for lots of things especially after the 0.23.5/ARM joint strength based on size/size, and also for FAR where wrong size/size joints cause trouble), this prodded me to recheck parts I had made using empties/transforms/NODE{}I vaguely remember something about these, but never see any configs using it... whats the difference between Hinge and fixed joints?Fixed_joint for your stack nodes and hinge_joint for other (radial etc) joints, some restrictions though (last two defined joints need to be your stack_node/fixed_joint's) Edited October 3, 2014 by NoMrBond Quote Link to comment Share on other sites More sharing options...
CaptainKipard Posted October 4, 2014 Author Share Posted October 4, 2014 (edited) Just tested. Sizes look right. Orientation must be +Z.This makes things so much easier.This deserves to be in the dev links thread. What's the terminology for this? All I can think of is that it's a "node node" Edited April 29, 2015 by Cpt. Kipard +Z not -Z Quote Link to comment Share on other sites More sharing options...
NoMrBond Posted October 4, 2014 Share Posted October 4, 2014 I think it was transform based node system? Quote Link to comment Share on other sites More sharing options...
hoojiwana Posted October 4, 2014 Share Posted October 4, 2014 I would be careful about using the NODE{} system, it has never worked as advertised since it was implemented. The original developer topic that introduced it has (I'm assuming) been moved into the moderator archive, and most of the experimentation people did was in that thread. There is this post that goes over a few of the rules people discovered about the system though. Quote Link to comment Share on other sites More sharing options...
NoMrBond Posted October 4, 2014 Share Posted October 4, 2014 The fixes to the NODE{} system certainly weren't widely advertised, and the exact nature of what was fixed wasn't laid out in the patch notesIt would be nice to have something official from one of the developers laying out the specifics Quote Link to comment Share on other sites More sharing options...
NathanKell Posted October 4, 2014 Share Posted October 4, 2014 That thread should have been in Dev anyway; I have moved it there. Link should work again. Quote Link to comment Share on other sites More sharing options...
ColdJ Posted yesterday at 01:59 PM Share Posted yesterday at 01:59 PM Rise, oh slightly confusing but gave me somewhere to start, thread. Quote Link to comment Share on other sites More sharing options...
ColdJ Posted 15 hours ago Share Posted 15 hours ago I have resurrected this thread for a reason. Though they discussed the issue they never fully resolved it because they decided to use NODE{} instead. I have been configuring stack nodes for years but due to rarely needing other than 90 degree or 45 degree angles I never truly thought about why we put in what we put in the rotational co-ordinates. Turns out the co-ordinate system is Trigonometry, some thing I haven't actively thought of in many decades. 1 or -1 represent a straight line away from the centre of your node location along 1 of the 6 axis. 3 positive and 3 negative. Now it can get confusing, at least for me, but a simple way to remember is this. Say you spawn the Mk1 inline cockpit into the Space Plane Hangar. Rotation X, Y, Z in the config file. -1.0, 0.0, 0.0 would make your node point towards the left side of the hangar when staring out the door. Allowing you to attach something with a stack node to the left side of the cockpit if you had configed a node to be on it's left side. 1.0, 0.0, 0.0 would have the node point to the right side of the hangar. 0.0, 1.0, 0.0 would have it face the open door, 0.0, -0.0, 0.0 the back wall. 0.0, 0.0, -1.0 the roof. 0.0, 0.0 1.0 the floor. For 45 degrees 1.0, 1.0, 0.0 will split the difference and have a node that points between the front and the right at a 45 degree angle from centre, etc. But say you want some unique angle. There are 2 ways of doing it. If you are physically building a model yourself in Blender or similar. Then you can add an empty to your project, give it a unique name, set it to show as Arrows and then point the Y axis of it in the direction you want your node to point. Then you can config the node like the following example. NODE { name = Join1 transform = node1 size = 2 method = FIXED_JOINT } The empty in the model is named node1 and it has it's positive Y axis pointing in the direction I want it to point in game. name = is just the name in the config to set it apart from other nodes. size = is the size of the node you want. method = is to determine if the node stays still or can be moved. HINGED_JOINT is used for robotic parts where the attach node can move. Method 2 which is what I mostly use and doesn't require access to a 3D modeling program. Use Trigonometry, cosine and sine, like working out the angles of a triangle through the lengths of the sides. In this image X is represented by Cos and Y by Sine. The angle I have chosen is 25 degrees. So to have the node I want point to 25 degrees left of straight out the door I neet to put the Cos number in my X co-ordinate and the Sine number in my Y co-ordinate. As long as you have access to the internet or have printed out the table that gives you the Cos and Sine of each degree of a circle, then you will be able to work it out. If you are wanting an angle up or down the simply swap thr Y co-ordinate to the Z value. If you need more complicated then you will need a co-ordinate in all 3. The circle has a 1 metre radius, so if you want to work it out in Blender you can place a 1 metre circle with 360 vertices at world centre. Go into Edit Mode and count around till you get the angle you want, then select that vertice and place the 3D cursor there. Go back to Object Mode and spawn an empty. When you look at the location info on the right, it will have the 2 measurements. If you need more complicated 3 co-ordinates then spawn a second circle at world centre that is turned 90 degrees to the first, then rotate it to the flat angle you want on the first circle before counting up it to choose the vertice you want, placing the 3D cursor there and then moving the empty to it so you can see it's 3 location measurements. Hope this helps people. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.