YSFlight Coordinate Systems

YSFlight general discussion & everything in between
Post Reply
User avatar
decaff_42
First Class Membership
First Class Membership
Posts: 3394
Joined: Sat Oct 29, 2011 7:23 pm
Favorite Aircraft: SR-71 Blackbird
Location: Eastern United States
OS: Mac OSX
Has thanked: 528 times
Been thanked: 1173 times
Contact:

YSFlight Coordinate Systems

Post by decaff_42 » Fri Nov 06, 2015 5:57 pm

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)
Check out my website YSDecaff for all my tutorials and addon releases.
Visit by Bitbucket page for Python codes: https://bitbucket.org/decaff42/

Feel free to ask me a question! I'll try to answer it as well as I can or recommend a more knowledgeable member if necessary.

User avatar
Flake
Staff
Staff
Posts: 4223
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Honda CBR1000RR (2004).
Location: Australia
OS: Windows 10 (x64)
Has thanked: 795 times
Been thanked: 1116 times
Contact:

Re: YSFlight Coordinate Systems

Post by Flake » Fri Nov 06, 2015 6:54 pm

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.

User avatar
Neocon
First Class Membership
First Class Membership
Posts: 3700
Joined: Wed Oct 19, 2011 5:01 am
Favorite Aircraft: Baron 58
Location: Tennessee
OS: Win Vista
Has thanked: 1502 times
Been thanked: 1624 times
Contact:

Re: YSFlight Coordinate Systems

Post by Neocon » Fri Nov 06, 2015 7:42 pm

I wonder if this is related to wind headings that are 180° opposite of what is inputted in OYS.

User avatar
decaff_42
First Class Membership
First Class Membership
Posts: 3394
Joined: Sat Oct 29, 2011 7:23 pm
Favorite Aircraft: SR-71 Blackbird
Location: Eastern United States
OS: Mac OSX
Has thanked: 528 times
Been thanked: 1173 times
Contact:

Re: YSFlight Coordinate Systems

Post by decaff_42 » Fri Nov 06, 2015 7:50 pm

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.
Check out my website YSDecaff for all my tutorials and addon releases.
Visit by Bitbucket page for Python codes: https://bitbucket.org/decaff42/

Feel free to ask me a question! I'll try to answer it as well as I can or recommend a more knowledgeable member if necessary.

User avatar
Flake
Staff
Staff
Posts: 4223
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Honda CBR1000RR (2004).
Location: Australia
OS: Windows 10 (x64)
Has thanked: 795 times
Been thanked: 1116 times
Contact:

Re: YSFlight Coordinate Systems

Post by Flake » Sat Nov 07, 2015 10:04 am

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:

User avatar
decaff_42
First Class Membership
First Class Membership
Posts: 3394
Joined: Sat Oct 29, 2011 7:23 pm
Favorite Aircraft: SR-71 Blackbird
Location: Eastern United States
OS: Mac OSX
Has thanked: 528 times
Been thanked: 1173 times
Contact:

Re: YSFlight Coordinate Systems

Post by decaff_42 » Sat Nov 07, 2015 12:13 pm

standard aviation terminology is for the wind to be coming FROM xxx compass heading, at least in the US.
Check out my website YSDecaff for all my tutorials and addon releases.
Visit by Bitbucket page for Python codes: https://bitbucket.org/decaff42/

Feel free to ask me a question! I'll try to answer it as well as I can or recommend a more knowledgeable member if necessary.

User avatar
Flake
Staff
Staff
Posts: 4223
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Honda CBR1000RR (2004).
Location: Australia
OS: Windows 10 (x64)
Has thanked: 795 times
Been thanked: 1116 times
Contact:

Re: YSFlight Coordinate Systems

Post by Flake » Sat Nov 07, 2015 1:05 pm

Yeah sounds right to me too. I'll change the way that is coded soon!

User avatar
Neocon
First Class Membership
First Class Membership
Posts: 3700
Joined: Wed Oct 19, 2011 5:01 am
Favorite Aircraft: Baron 58
Location: Tennessee
OS: Win Vista
Has thanked: 1502 times
Been thanked: 1624 times
Contact:

Re: YSFlight Coordinate Systems

Post by Neocon » Sat Nov 07, 2015 3:49 pm

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.

User avatar
Flake
Staff
Staff
Posts: 4223
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Honda CBR1000RR (2004).
Location: Australia
OS: Windows 10 (x64)
Has thanked: 795 times
Been thanked: 1116 times
Contact:

Re: YSFlight Coordinate Systems

Post by Flake » Sun Nov 08, 2015 1:30 am

I'll make the change! :) (Simple as doing a +180 in my code!)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest