Re: [Algorithms] Left-handed vs. right-handed
Brought to you by:
vexxed72
|
From: Graham H. <gra...@ge...> - 2009-05-06 10:12:54
|
In the best of all possible worlds you would flip a coin and set a universal convention for your whole project. Just check the appropriate box in your authoring application, create your graphics device with a suitable flag and---oh, wait... Since it's clearly "correct" to be agnostic, I prefer to work with the chirality that the graphics driver expects. You may have to apply a transform with negative determinant to your data somewhere---but I would rather do that once and for all time in a pre-process. If you try to cope in your code you will inevitably end up stuck between artists (or---worse---mathematicians) who fervently believe the world is right-handed and a driver which stubbornly assumes it's left-handed. I can guarantee that keeping track of where all the minus signs have to go will hurt your head (been there!). The view matrix is only one of your worries---there are several other operations which are inherently 3D and come with a sign convention built in. The cross-product springs immediately to mind, but the really filthy one is sampling a cube map---there are six faces, each with an orientation, so if you have two different coordinate systems floating around the sheer combinatorial possibilities for screwing this up are pretty daunting... Graham From: Eric Haines [mailto:eri...@gm...] Sent: 06 May 2009 05:10 To: Game Development Algorithms Subject: [Algorithms] Left-handed vs. right-handed I've written up my way of thinking about left-handed and right-handed world and viewing systems. It's a bit long-winded, but here it is: http://www.realtimerendering.com/blog/left-handed-vs-right-handed-viewin g/ This topic is in one sense basic stuff, but it leads to so much confusion. Neither DirectX nor OpenGL does a good job of dealing with this confusion, IMO. In our book we kind of sidestep the whole issue (choose RH, stay RH). I'd love to get any feedback and corrections from people on this list (either here on the list, via private email, or on the blog), as I expect there are ways of thinking about it I hadn't even considered or have misinterpreted. Eric |