OpenGL Perspective Projection Right Handed to Left Handed

Поделиться
HTML-код
  • Опубликовано: 6 фев 2025
  • OpenGL uses a right-handed coordinate system until the perspective projection where OpenGL switches to a left-handed coordinate space for the depth buffer (z-buffer) test.

Комментарии • 8

  • @ThatOSDev
    @ThatOSDev 2 месяца назад

    Just for clarification. The statement that "OpenGL is a Right-Handed Coordinate System" is not entirely accurate. OpenGL allows you to use left or right. Direct3D (Part of DirectX) is strictly Left-Handed. OpenGL however has functions that allow you to choose which set of vectors you want to use. With that said though, most people use Right-Handed, since it's the most common and is taught in most tutorials. How would you write OpenGL to use Left-Handed ? You would mirror, or flip, your transforms to what you normally would with Right-Handed.

  • @as12df12
    @as12df12 11 лет назад +6

    I've been reading this a lot, but I just don't get it. Why does OpenGL "use" a right-handed coordinate system? I mean, OpenGL is not actually using anything in particular! It's _me_, the programmer, using a coordinate system, and I can have my model, world and camera space all in left-handed if I want, just gotta feed an appropriate left-handed projection matrix (with a non-inverted homogenous z-base vector in it, e.g. with a w-component = 1, instead of -1 like gluPerspective does) into OpenGL, right?
    Also, couldn't I have clip space in right-handed no problem by just feeding in a right-handed projection matrix and setting the depth compare function to greater-than?
    Not to mention that modern OpenGL doesn't even have a matrix stack anymore, and all relevant transformations are fully programmable - are required to be programmed by the client even!
    Is there a particular reason why people keep insisting (and teaching in University, for that matter) that OpenGL "is right-handed"?

    • @darkside3ng
      @darkside3ng 6 лет назад +2

      If I am not wrong, opengl uses, in fact, the right-hand rule. If you draw a line from 0 - 1 in x-axis, 0 - 1 in y-axis, and 0-1 in z-axis, you will se that it is a right-hand standard. Also try to make simple rotation around a single axis, you will see the rotation also following the right-hand.
      Of course that, with appropriated matrix manipulation you can make your system behave in opposite direction, but, in essence, I beleave that the righ-hand is the norm.

    • @peki_ooooooo
      @peki_ooooooo 2 года назад

      good question.

  • @anonymoussloth6687
    @anonymoussloth6687 4 года назад

    Why was the other objects geting smushed to a 2d plane while this cube didn't in the perspective transform?

  • @MrCybin
    @MrCybin 8 лет назад

    This video is not in the github list. There is no code for this tutorial.

  • @Valentyn90A
    @Valentyn90A 8 лет назад +1

    Why are you such a liar, Jamie? :)