technomage
New member
- Joined
- Sep 9, 2011
- Messages
- 2
- Reaction score
- 0
- Points
- 1
I'm trying to duplicate the yaw, pitch and roll buttons in the scenario editor in an MFD. Specifically, I want to yaw a vessel 1 degree relative to it's local frame. I've tried to look at posts about vessel orientation and translation between local and global orientation but either they don't apply or they're way above my head. Coordinate translation is easy but angles are confusing me.
Changing the arot property of the vessel status works if the vessel is aligned with the ecliptic but fails once it is rotated away. I tried altering the rotation matrix directly but that didn't work. I think I need to:
Or maybe I need to get, alter and set the vessel's rotation matrix. I just can't get my head around how to use the rotation matrix.
Changing the arot property of the vessel status works if the vessel is aligned with the ecliptic but fails once it is rotated away. I tried altering the rotation matrix directly but that didn't work. I think I need to:
Code:
VESSEL *localVessel = oapiGetFocusInterface();
MATRIX3 localRotationMatrix;
VESSELSTATUS2 localVesselStatus; //memset, etc.
localVessel->GetStatusEx(&localVesselStatus);
localVessel->GetRotationMatrix(localRotationMatrix);
//Use localRotationMatrix to get a localVector from localStatus.arot
localVector.y += RAD*1;
//Use localRotationMatrix to convert localVector to localStatus.arot
Or maybe I need to get, alter and set the vessel's rotation matrix. I just can't get my head around how to use the rotation matrix.