|
MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API glm::vec3 MayaFlux::normalize_coords | ( | double | window_x, |
| double | window_y, | ||
| uint32_t | window_width, | ||
| uint32_t | window_height | ||
| ) |
Convert window pixel coordinates to normalized device coordinates (NDC)
| window_x | X coordinate in window space [0, width] |
| window_y | Y coordinate in window space [0, height] (top-left origin) |
| window_width | Window width in pixels |
| window_height | Window height in pixels |
Window coordinates use top-left origin with Y increasing downward. NDC coordinates use center origin with Y increasing upward. Z is always set to 0.0 for 2D screen-space positions.
Example: normalize_coords(0, 0, 800, 600) → (-1.0, -1.0, 0.0) // top-left normalize_coords(400, 300, 800, 600) → (0.0, 0.0, 0.0) // center normalize_coords(800, 600, 800, 600) → (+1.0, +1.0, 0.0) // bottom-right
Definition at line 23 of file Windowing.cpp.
Referenced by normalize_coords().
Here is the caller graph for this function: