opengl-tutorials / ogl

http://www.opengl-tutorial.org
2.69k stars 925 forks source link

why lRayEnd_NDC's z setted to 0 in misc05_picking_custom example #132

Open dandingol03 opened 12 months ago

dandingol03 commented 12 months ago

HI, thanks for the tutorial about mouse picking.

glm::vec4 lRayEnd_NDC(
        ((float)mouseX/(float)screenWidth  - 0.5f) * 2.0f,
        ((float)mouseY/(float)screenHeight - 0.5f) * 2.0f,
        0.0,
        1.0f
    );

why lRayEnd_NDC's z coordinate is setted to 0? For my opinion, the far plane's z coordinate in ndc is 1