mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
added second method of w2s
This commit is contained in:
@@ -214,3 +214,20 @@ TEST(UnitTestMatStandalone, Enverse)
|
||||
|
||||
EXPECT_EQ(mv, m.inverted());
|
||||
}
|
||||
|
||||
TEST(UnitTestMatStandalone, Equanity)
|
||||
{
|
||||
constexpr omath::Vector3<float> left_handed = {0, 2, 10};
|
||||
constexpr omath::Vector3<float> right_handed = {0, 2, -10};
|
||||
|
||||
auto proj_left_handed = omath::mat_perspective_left_handed(90.f, 16.f / 9.f, 0.1, 1000);
|
||||
auto proj_right_handed = omath::mat_perspective_right_handed(90.f, 16.f / 9.f, 0.1, 1000);
|
||||
|
||||
auto ndc_left_handed = proj_left_handed * omath::mat_column_from_vector(left_handed);
|
||||
auto ndc_right_handed = proj_right_handed * omath::mat_column_from_vector(right_handed);
|
||||
|
||||
ndc_left_handed /= ndc_left_handed.at(3, 0);
|
||||
ndc_right_handed /= ndc_right_handed.at(3, 0);
|
||||
|
||||
EXPECT_EQ(ndc_left_handed, ndc_right_handed);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user