MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ to_ndc()

glm::vec3 MayaFlux::Kinesis::to_ndc ( double  window_x,
double  window_y,
uint32_t  width,
uint32_t  height 
)
inline

Convert window pixel coordinates to NDC.

Parameters
window_xX in window space [0, width]
window_yY in window space [0, height] (top-left origin)
widthWindow width in pixels
heightWindow height in pixels
Returns
NDC (x, y, 0) in [-1, +1], center origin, +Y up

Definition at line 114 of file ViewTransform.hpp.

117{
118 return {
119 (static_cast<float>(window_x) / static_cast<float>(width)) * 2.0F - 1.0F,
120 1.0F - (static_cast<float>(window_y) / static_cast<float>(height)) * 2.0F,
121 0.0F
122 };
123}
uint32_t width

References width.

Referenced by MayaFlux::normalize_coords(), and MayaFlux::normalize_coords().

+ Here is the caller graph for this function: