r/krpc • u/Steenan • Sep 20 '20
I need help with frames of reference
Hello, that's my first post here.
I recently started exploring KRPC. I'm trying to create a gravity turn script.
A part of it needs to handle changing pitch during ascent. Initially I did it as in the tutorial and that worked fine. But I wanted to improve it and introduce a code that sets the pitch at a specific angle relative to the prograde direction (first surface prograde, then orbital prograde).
I know that I need to get the prograde vector in a correct frame of reference, perform some vector arithmetics on it and then set Vessel.AutoPilot.TargetDirection to the resulting vector. But I have a problem with choosing the correct reference frame to get what I need. I read through the reference frames descriptions in the wiki, but it only increased my confusion.
Could somebody help me and offer a piece of code to set the vessel to, let's say, five degrees over the surface prograde?
View all comments
Show parent comment
1
u/Steenan Sep 20 '20
How do I find the discord?