Jump to content
The simFlight Network Forums

Recommended Posts

Posted

I'd like to write my own camera utility to create, edit and delete my own camera views for FSX.

 

My development environment is VS 2013 C# and I already have a registered copy of FSUIPC and also Paul's FSUIPC Client .DLL. So I can already 'talk' to FSX.

 

I'm wondering if there are any tutorials that sort of go over the steps needed to create your own camera views?

 

My assumptions at this point are:

 

1. Camera views are contained inside a specific aircraft's .cfg file?

 

2. To create a new camera view, requires creating a new camera entry in the aircraft.cfg file ([CameraDefinition.2] section for example)?

 

3. I'm not sure how to activate a camera view via FSUIPC? I assume I would need to send a camera command to FSX?

 

4. So my camera app would mainly have to read and write to the aircraft.cfg file (in the camera section) and then just select which camera view to switch to?

 

5. What is the difference between the camera.cfg file and an aircraft.cfg file (the camera settings in each one I mean)? Why are there two .cfg files to define and control cameras?

 

Thanks for any pointers and help in where to read more about how to do this project.

 

Posted

So that web page provides some excellent information on the cockpit cameras, how to create them and how to edit existing ones. I have to edit the specific aircraft config file.

 

From a development point of view, I'm wondering how a camera app edits the aircraft config file and shows the effect of the changes in real time? In other words, is this done in memory until finished and then the .cfg file data is written to the disk -- or -- are the changes done to the .cfg file and they have to be written to the disk and the aircraft.cfg file re-loaded to see the changes?

 

I'm trying to find out what the edit/load/refresh cycle is for aircraft .cfg file.

 

Pete - I'm wondering if I can do this camera app using FSUIPC or if I need to make use of SimConnect?

Posted

I'm trying to find out what the edit/load/refresh cycle is for aircraft .cfg file.

 

I'm pretty sure any changes wil be activated if you use the "reload aircraft" FS control to reload.

 

Pete - I'm wondering if I can do this camera app using FSUIPC or if I need to make use of SimConnect?

 

There's nothing in FSUIPC or SimConnect to edit CFG files for you, so I don't think that's relevant. You just need to be able to send the Reload Aircraft control after you've edited the file. You can do that with FSUIPC or SimConnect, or even directly by sending the FS98Main class window the control in a WM_COMMAND message.

 

HOWEVER, you can manipulate a user camera directly in SimConnect, using this function:

 

 
SimConnect_CameraSetRelative6DOF

The SimConnect_CameraSetRelative6DOF function is used to adjust the user's aircraft view camera.

Syntax

HRESULT SimConnect_CameraSetRelative6DOF(

  HANDLE  hSimConnect,

  float  fDeltaX,

  float  fDeltaY,

  float  fDeltaZ,

  float  fPitchDeg,

  float  fBankDeg,

  float  fHeadingDeg

);

 

 

Have you investigated this? It isn't supported through FSUIPC, though, you have to interface to SimConnect.

 

Pete

Posted

Thanks Pete...that looks like what is needed to dynamically update the x y z p b h values in real time...and then once set, write those values to the appropriate aircraft.cfg file.

 

Update: I've had a detailed look at the aircraft.cfg file structure and it's just like a Windows .ini file so I have a C# Class to read and write to ini files already. So, that part is now solved as far as how to do it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.