Jump to content

Why left handed coordinate system?


Kesshi
 Share

Recommended Posts

I would like to know why BabylonJs uses left handed coordinates.
I mean OpenGL is right handed, most of the software i know is right handed (Blender).
I know that early versions of DirectX were left handed but nowadays it supports both.
It would be nice if BabylonJs also had a switch for this.
At the moment i have do convert all my data/models from right to left handed.

Link to comment
Share on other sites

Hi Kesshi,

I am not sure how to answer this question :)

I am not the one who decided left or right handed, but I am one of the people who decided to use this framework, with both its good and bad sides (not that I am saying there are bad sides, of course). You can also say that 3DS (and STL! And Cannon.js) have Z as the up-axis, so why can't we support that as well?

If you don't like the left handed system, you can always change the source in your own fork (I guess those are simple changes in the engine) and enjoy BJS right-handed.

Knowing how @Deltakosh keeps the framework backwards-compatible, this will probably never happen. But who knows  ? ;) 

Link to comment
Share on other sites

BJS is left handed because...we had to make a choice :)

As raanan mentioned, we also decided to be Y up where others did differently. 

 

You can still consider changing Babylon.js to right handed with little changes:

- Change Matrix.LookAtLHoRef to be right handed: https://github.com/BabylonJS/Babylon.js/blob/master/src/Math/babylon.math.ts#L2475

- Change Matrix.PerspectiveFovLHToRef to be right handed: https://github.com/BabylonJS/Babylon.js/blob/master/src/Math/babylon.math.ts#L2569

 

 

And you're done :D

Link to comment
Share on other sites

10 hours ago, Deltakosh said:

You can still consider changing Babylon.js to right handed with little changes:

- Change Matrix.LookAtLHoRef to be right handed: https://github.com/BabylonJS/Babylon.js/blob/master/src/Math/babylon.math.ts#L2475

- Change Matrix.PerspectiveFovLHToRef to be right handed: https://github.com/BabylonJS/Babylon.js/blob/master/src/Math/babylon.math.ts#L2569

And you're done :D

Its not enough i think. Maybe face winding and depth func also need to be changed ...
I think i will not mess around with those things for now :D

Its a bit extra work but I just need to make sure to always make the correct conversions when exchanging data between our offline appliaction and the new online one. I wrote a basic function already to convert a mesh/geometry from right to left handed.

... maybe i modify the obj loader to do this directly while loading. Most obj files found in the internet should be right handed anyway.
Things like z-up can be easily fixed by the user by roating the object.
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...