• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX Get camera position & angle using simconnect in C#

Messages
1
Country
us-colorado
I'm a seasoned C# developer, and the last couple weeks I've been playing around with simconnect, hoping to build a custom tool for a flight simulator I'm in the process of building.

What I really need is the ability to GET the current camera position and angle (x,y,z,p,b,h). I have successfully been able to use CameraSetRelative6DOF() to set the position and TransmitClientEvent() to change the zoom level, but I'm at a loss in figuring out how to read the position from the sim. My goal is to get these 6 values from the sim and be able to set them in a config file for a new camera configuration in the aircraft.cfg file.

Anyone know how to accomplish this?
 
A lot of people including myself have wanted to do this, so I'm 99.9% sure there isn't an easy way.
The harder ways I know of are :
1) Save the flight using Simconnect. Open the .FLT file via code, get the [Window.1] Current Camera GUID, match it to correct the [Camera.1.x] entry and read the saved translation and rotation values.
This method is fine for one off instances, but if you are trying to do continual updates, you are likely to induce stuttering in the Sim as it saves.
2) Implement your own camera control so you where the camera is all the time. Lots of work however.
3) Move to Prepar3D which carried on developing Simconnect, including reading the camera 6DOF among many other new features.
 
Back
Top