Page 1 of 1

YSFlight Coordinate Systems

Posted: Fri Nov 06, 2015 5:57 pm
by decaff_42
So I've been playing around with .yfs files and I've noticed something kind of funny. In Scenery Editor, the positive X axis is to the right, while the positive Z axis is towards the bottom of the screen. I put in a Start position at (x=-200, z=0) and flew from that in YSFlight. (Y coordinate doesn't really matter here) The start position is pointing north, which matched up to my compass when I flew from this start position.

I saved the flight to a .yfs file and noticed something interesting. The position coordinates showed my increasing z axis position, while the -200 x axis coordinate stayed relative constant until I started to turn to the left and got more negative x axis coordinate.

Does anyone know why this coordinate switching happens? If the in-game coordinate system is correct, then It is not a true Cartesian system (y-axis is flipped), but in Scenery Editor, it is a true Cartesian system.


I also learned that the Rotation sections of the .yfs file is Compass heading (+ between N-W-S and - btwn N-E-S), Horizon (+ up, -down), and bank angle (+ left wing down, - right wing down)

Re: YSFlight Coordinate Systems

Posted: Fri Nov 06, 2015 6:54 pm
by Flake
I think soji used a right hand rule system for the scenery dev and a left hand rule system for ysf.

I have experienced this as well and thus there are negation multiplications in OYS code to correct.

Re: YSFlight Coordinate Systems

Posted: Fri Nov 06, 2015 7:42 pm
by Neocon
I wonder if this is related to wind headings that are 180° opposite of what is inputted in OYS.

Re: YSFlight Coordinate Systems

Posted: Fri Nov 06, 2015 7:50 pm
by decaff_42
Okay, I'm glad it is not just me. So if I flip the sign of the z-coordinate, I can get the 'true' right-hand coordinates.

This will slightly complicate the vector coordinate system rotation, but nothing too bad. My only problem will probably be to get VBA to do vector multiplication quickly enough to analyze >10000 time slices in a reasonable amount of time.

Re: YSFlight Coordinate Systems

Posted: Sat Nov 07, 2015 10:04 am
by Flake
Patrick31337 wrote:I wonder if this is related to wind headings that are 180° opposite of what is inputted in OYS.
No that's probably just me being derpy haha.

Is the wind going FROM heading when it's supposed to be TO or vice versa? I can fix that quickly... :lol:

Re: YSFlight Coordinate Systems

Posted: Sat Nov 07, 2015 12:13 pm
by decaff_42
standard aviation terminology is for the wind to be coming FROM xxx compass heading, at least in the US.

Re: YSFlight Coordinate Systems

Posted: Sat Nov 07, 2015 1:05 pm
by Flake
Yeah sounds right to me too. I'll change the way that is coded soon!

Re: YSFlight Coordinate Systems

Posted: Sat Nov 07, 2015 3:49 pm
by Neocon
OfficerFlake wrote:Is the wind going FROM heading when it's supposed to be TO or vice versa?
This is very confusing to me, as well, even after long talks with Turbofan about the matter. :lol: Wind direction is the heading from which the wind is blowing.

Currently, if I set the wind in OYS to 270, the wind comes from the east and will blow a hovering helicopter toward 270. The wind heading should blow the helicopter the opposite direction of the direction reported by /weather.

Re: YSFlight Coordinate Systems

Posted: Sun Nov 08, 2015 1:30 am
by Flake
I'll make the change! :) (Simple as doing a +180 in my code!)