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,10 +238,8 @@ 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
1 | 1 |
@@ -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};
} }
@@ -261,18 +273,16 @@ namespace omath::projection
ndc_to_screen_position_from_bottom_left_corner(const Vector3<float>& ndc) const noexcept ndc_to_screen_position_from_bottom_left_corner(const Vector3<float>& ndc) const noexcept
{ {
/* /*
^ ^
| y |
1 | |
| |
| |
-1 ---------0--------- 1 --> x |
| |
| | (0, 0)
-1 | +------------------------>
v */
*/
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