YSFlight Coordinate Systems

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

YSFlight Coordinate Systems

Post 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)
Check out my website YSDecaff for all my tutorials and addon releases.
Visit my GitHub page for Python codes: https://github.com/decaff42?tab=repositories

YSFlight Addon Database - Find links to nearly every addon made for YSFlight!
Submit Addon To Database
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: YSFlight Coordinate Systems

Post 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.
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Neocon
First Class Membership
First Class Membership
Posts: 3955
Joined: Wed Oct 19, 2011 5:01 am
Favorite Aircraft: Baron 58
Location: Tennessee
OS: Win 10
Has thanked: 1769 times
Been thanked: 1810 times
Contact:

Re: YSFlight Coordinate Systems

Post by Neocon »

I wonder if this is related to wind headings that are 180° opposite of what is inputted in OYS.
User avatar
decaff_42
Staff
Staff
Posts: 3838
Joined: Sat Oct 29, 2011 7:23 pm
Favorite Aircraft: SR-71 Blackbird
Location: Eastern United States
OS: Mac OSX
Has thanked: 844 times
Been thanked: 1726 times
Contact:

Re: YSFlight Coordinate Systems

Post 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.
Check out my website YSDecaff for all my tutorials and addon releases.
Visit my GitHub page for Python codes: https://github.com/decaff42?tab=repositories

YSFlight Addon Database - Find links to nearly every addon made for YSFlight!
Submit Addon To Database
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: YSFlight Coordinate Systems

Post 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:
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
decaff_42
Staff
Staff
Posts: 3838
Joined: Sat Oct 29, 2011 7:23 pm
Favorite Aircraft: SR-71 Blackbird
Location: Eastern United States
OS: Mac OSX
Has thanked: 844 times
Been thanked: 1726 times
Contact:

Re: YSFlight Coordinate Systems

Post by decaff_42 »

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 my GitHub page for Python codes: https://github.com/decaff42?tab=repositories

YSFlight Addon Database - Find links to nearly every addon made for YSFlight!
Submit Addon To Database
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: YSFlight Coordinate Systems

Post by Flake »

Yeah sounds right to me too. I'll change the way that is coded soon!
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Neocon
First Class Membership
First Class Membership
Posts: 3955
Joined: Wed Oct 19, 2011 5:01 am
Favorite Aircraft: Baron 58
Location: Tennessee
OS: Win 10
Has thanked: 1769 times
Been thanked: 1810 times
Contact:

Re: YSFlight Coordinate Systems

Post 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.
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: YSFlight Coordinate Systems

Post by Flake »

I'll make the change! :) (Simple as doing a +180 in my code!)
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests