Search results

  1. Evgheny

    General Question Converting Eulers to Pitch-Yaw-Bank

    I know that, Euler angles in Eulers are in 'ZYX' convention, so first rotation is about z-global axis: so, in (alpha, beta, gamma) Eulers, the third angle is the vessel's roll - because vessel's z-axis matches global z-axis when Eulers angles are (0,0,0) I'm trying to understand your answer in...
  2. Evgheny

    General Question Converting Eulers to Pitch-Yaw-Bank

    How to convert Eulers angles to Pitch-Yaw-Bank? This functionality can be demonstrated in Scenario Editor. There, I can modify Pith, Yaw or Bank and see how Euler angles are modified.
  3. Evgheny

    API Question oapiCameraRotPolar (and Azimuth) problem question

    Hello forum. I've noticed that I need to double the argument to get correct angle. What is that? Is it my misunderstanding the function, or some other problem? Here is the code, It was executed only once. I've executed it in debug mode to see results of every string (results are written in...
  4. Evgheny

    API Question How to use GlobalRot function (or how to direct Vessel towards Sun)?

    Thanks. I've corrected code and got almost good result. Here is corrected code for Martin's approach: // initial rotation matrix MATRIX3 Rot0; pVessel->GetRotationMatrix(Rot0); // direction is Sun VECTOR3 direction; pVessel->Global2Local(sunpos, direction); // normalise direction =...
  5. Evgheny

    API Question Put your spacecraft in conjunction with Earth

    Yeap, now I understood the theory of Orbiter's coordinate systems. Thank you very much. For the same as I, I upload a drawing, representing relations of Orbiter's coordinate systems.
  6. Evgheny

    API Question How to use GlobalRot function (or how to direct Vessel towards Sun)?

    I've tried: // global sunpos OBJHANDLE Sun = oapiGetGbodyByName("Sun"); VECTOR3 sunpos; oapiGetGlobalPos(Sun, &sunpos); // ... VECTOR3 objpos; oapiGetGlobalPos(hVessel, &objpos); VECTOR3 direction = sunpos-objpos; // normalise direction...
  7. Evgheny

    API Question How to use GlobalRot function (or how to direct Vessel towards Sun)?

    I've just tried Martin's solution, and I haven't succeeded. Maybe I'm doing something wrong? Here is my code: DLLCLBK void opcOpenRenderViewport (HWND hWnd, DWORD w, DWORD h, BOOL fullscreen) { /** * Celestial bodies that we need */ OBJHANDLE Sun = oapiGetGbodyByName("Sun"); OBJHANDLE...
  8. Evgheny

    API Question How to use GlobalRot function (or how to direct Vessel towards Sun)?

    Thank you very much. I understand the approach. Tomorrow I'll try and then post the code if it works (It should work)
  9. Evgheny

    API Question Put your spacecraft in conjunction with Earth

    Big thanks for explanation. Almost everything is clear now, just few questions: from 2 to 3 - is it only rotation? If frames differ only in rotation, it means that their origins match. In local system (3), origin of frame is the center of gravity of object. So coordinates of Vessel will be [0...
  10. Evgheny

    API Question How to use GlobalRot function (or how to direct Vessel towards Sun)?

    Ok. I got it. Yeap, direction is only direction of nose. But we can rotate this nose about it's own z-axis. But even then - I should got nose (or back, if it's error in sign) directed to Sun, and any roll angle. (with my code). But I haven't got nose directed to Sun. Can you please advice me...
  11. Evgheny

    API Question How to use GlobalRot function (or how to direct Vessel towards Sun)?

    I can get direction of Sun. But Orbiter SDK has 2 ways of setting Vessel orientation: setting vessel status field arot in Euler Angles and setting Rotation Matrix by function setRotationMatrix. But why then I need 'Directions' (pointing vectors) and GlobalRot function, if I could change...
  12. Evgheny

    API Question Put your spacecraft in conjunction with Earth

    Yeap, I've already knew (from here) about barycenter in [0,0,0]. (And I use Orbiter 2006, so it's not new) Ok. Thanks. Understand. So. rpos is global coordinates relative to reference body. But not local - that's why the first example of code doesn't work?
  13. Evgheny

    API Question Put your spacecraft in conjunction with Earth

    Sorry, if I messed up with the title, don't know how to say correct this in English. (edited, thanks 2 Keatah) What I need: I need to put my Vessel on a line "Earth - Sun" but at the opposite (to Earth) side of Sun. Vessel ---- SUN ---- Earth I've tried to do it in such a way: //...
  14. Evgheny

    API Question How to use GlobalRot function (or how to direct Vessel towards Sun)?

    Hielor I've understood difference between local and relative, thank you. GlobalRot used to transform directions. But direction it's meant 3d point (xyz) on what object is pointing (but not three euler angles of object). How to get current direction of Vessel? I can get Rotation Matrix...
  15. Evgheny

    API Question How to use GlobalRot function (or how to direct Vessel towards Sun)?

    So, rloc is XYZ cartesian point, but not [a b g] Euler angles? There is a note in Reference: So, If I have a point xyz (relative to rbody) and I want to get global position (x,y,z) I call Local2Global. But with GlobalRot then I still have misunderstanding
  16. Evgheny

    API Question What's the origin of Coordinate System in Orbiter?

    Coordinates Y of Sun and Earth are not equal. It means that Orbiter XZ Plane (Y=0) is not parallel to Ecliptic Plane? Why does it call Ecliptic Frame then?
  17. Evgheny

    API Question How to use GlobalRot function (or how to direct Vessel towards Sun)?

    Hello forum. From the API Reference: What does it mean by "local coordinates"? If my vessel is orbiting Sun (its rbody is Sun), so relative direction to Sun is local coordinates? I need to turn my Vessel directly to Sun, and I've tried with this function (converting [0 0 0] direction to...
  18. Evgheny

    API Question Usage of undocumented classes and function

    I'd like to up a question from 2010: http://www.orbiter-forum.com/showthread.php?t=15963 In OrbiterApi.h I see such classes as: CameraMode CameraMode_Cockpit CameraMode_Track etc. I've tried to use them, but haven't succeed. Maybe somebody had luck to use them correctly? Can you give an...
  19. Evgheny

    API Question What's the origin of Coordinate System in Orbiter?

    Thank you, now I understand.
  20. Evgheny

    API Question What's the origin of Coordinate System in Orbiter?

    Hello Forum. What is the origin of Coordinate System in Orbiter? I use this function from Orbiter SDK API: I've got position of Sun and Earth by this function: (values are rounded to integers) R = dist(sunPos, earthPos) returns 148761959054, that's similar to 149.6*10^6 from wikipedia...
Top