updated comments

This commit is contained in:
2025-10-23 00:48:54 +03:00
parent 5a4026a4fc
commit a7eacb529e
2 changed files with 31 additions and 16 deletions

View File

@@ -238,9 +238,7 @@ namespace omath::projection
return std::ranges::any_of(ndc.raw_array(), [](const auto& val) { return val < -1 || val > 1; }); return std::ranges::any_of(ndc.raw_array(), [](const auto& val) { return val < -1 || val > 1; });
} }
[[nodiscard]] Vector3<float> // NDC REPRESENTATION:
ndc_to_screen_position_from_top_left_corner(const Vector3<float>& ndc) const noexcept
{
/* /*
^ ^
| y | y
@@ -254,6 +252,20 @@ namespace omath::projection
v v
*/ */
[[nodiscard]] Vector3<float>
ndc_to_screen_position_from_top_left_corner(const Vector3<float>& ndc) const noexcept
{
/*
+------------------------>
| (0, 0)
|
|
|
|
|
|
*/
return {(ndc.x + 1.f) / 2.f * m_view_port.m_width, (ndc.y / -2.f + 0.5f) * m_view_port.m_height, ndc.z}; return {(ndc.x + 1.f) / 2.f * m_view_port.m_width, (ndc.y / -2.f + 0.5f) * m_view_port.m_height, ndc.z};
} }
@@ -262,17 +274,15 @@ namespace omath::projection
{ {
/* /*
^ ^
| y
1 |
| |
| |
-1 ---------0--------- 1 --> x
| |
| |
-1 | |
v |
| (0, 0)
+------------------------>
*/ */
return {(ndc.x + 1.f) / 2.f * m_view_port.m_width, (ndc.y / 2.f + 0.5f) * m_view_port.m_height, ndc.z}; return {(ndc.x + 1.f) / 2.f * m_view_port.m_width, (ndc.y / 2.f + 0.5f) * m_view_port.m_height, ndc.z};
} }

View File

@@ -0,0 +1,5 @@
//
// Created by Vlad on 10/23/2025.
//
#pragma once