Search Results

Search found 2 results on 1 pages for 'okoman'.

Page 1/1 | 1 

  • Normalized Device Coordinates to window coordinates

    - by okoman
    I just read some stuff about the theory behind 3d graphics. As I understand it, normalized device coordinates (NDC) are coordinates that describe a point in the interval from -1 to 1 on both the horizontal and vertical axis. On the other hand window coordinates describe a point somewhere between (0,0) and (width,height) of the window. So my formula to convert a point from the NDC coordinate system to the window system would be xwin = width + xndc * 0.5 * width ywin = height + ynfv * 0.5 * height The problem now is that in the OpenGL documentation for glViewport there is an other formula: xwin = ( xndc + 1 ) * width * 0.5 + x ywin = ( yndc + 1 ) * height * 0.5 + y Now I'm wondering what I am getting wrong. Especially I'm wondering what the additional "x" and "y" mean. Hope the question isn't too "not programming related", but I thought somehow it is related to graphics programming.

    Read the article

1