Python-SimConnect icon indicating copy to clipboard operation
Python-SimConnect copied to clipboard

Move camera?

Open viperML opened this issue 4 years ago • 3 comments

Hello, I am a student from the Polytechnic University of Madrid working in a aerospace project for UAV's. What I am currently doing is getting simulation data from JSBSim, and wanted to display it using MSFS.

By using this interface I am able to send the aircraft position to the sim, but I also wanted to control the camera. I have searched all the documentation and property list but cannot find anything to modify any camera parameters (angles, positions and FOV). Maybe this is possible with SimConnect for P3D, but I haven't tried yet.

I have also tried sending input commands with vJoy to the sim, but turns out to be very unpredictable.

Thanks for your time.

viperML avatar Mar 12 '21 09:03 viperML

Yes, I investigate this as well and my conclusion was the Sim developers do not provide external camera control interface. The simconnect interface does not seem to be a priority for them. You can send keystrokes but very limited.

There are some interesting discussions in the community about using a pair of components, a custom WASM module, and a external program that feeds custom data. https://forums.flightsimulator.com/t/communication-between-wasm-plugin-and-external-application/358409/7 Currently this is to feed control panel information and I see no sign that anyone has tried to control the cameras. But that is the only direction I have seen that offers a solution (unless Asobo team changes their plans regarding simconnect).

FS2020-USER-TESTER avatar Mar 12 '21 13:03 FS2020-USER-TESTER

I managed to use CameraSetRelative6DOF() by going in the Attributes.py and setting

self.CameraSetRelative6DOF.argtypes = [
			HANDLE,
			c_float,
			c_float,
			c_float,
			c_float,
			c_float,
			c_float
		]

then I simply did this:

sm = SimConnect()
hr = sm.dll.CameraSetRelative6DOF(sm.hSimConnect,0.0, 10.0, -100.0, 0.0, 0.0, 0.0)

This works for me.

NerdyMuppet avatar Mar 16 '22 08:03 NerdyMuppet

@NerdyMuppet This is working for me. Thank you for the tip

bigsby-exe avatar Mar 24 '22 21:03 bigsby-exe