From 9974c01aaf58731400f3e72be4d95f96a393a367 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 16 Jul 2020 17:23:02 +0200 Subject: Use correct window ratio for --plane mode --- src/main.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 5e4cd74..ea375e6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -569,7 +569,7 @@ CMainApplication::CMainApplication( int argc, char *argv[] ) cursor_scale_uniform[0] = 0.0f; cursor_scale_uniform[1] = 0.0f; -#ifdef DEBUG +#ifdef _DEBUG m_bDebugOpenGL = true; #endif }; @@ -1757,19 +1757,22 @@ void CMainApplication::AddCubeToScene( const glm::mat4 &mat, std::vector long columns = 64; double angle_start = -0.8; double angle_end = 0.8; - double radius = 1.5 * width_ratio; double height = 1.5; - double angle_len = angle_end - angle_start; + double width_start = sin(angle_start); + double width_end = sin(angle_start + angle_len); + double target_radius = height * width_ratio; + double radius = 2.0 * (target_radius / (width_end - width_start)); + for(long column = 0; column < columns; ++column) { double t1 = ((double)column / (double)columns); double t2 = (((double)column + 1) / (double)columns); double x1 = sin(angle_start + t1 * angle_len) * radius; - double y1 = cos(angle_start + t1 * angle_len) * radius * 0.5; + double y1 = cos(angle_start + t1 * angle_len) * radius * 0.75; double x2 = sin(angle_start + t2 * angle_len) * radius; - double y2 = cos(angle_start + t2 * angle_len) * radius * 0.5; + double y2 = cos(angle_start + t2 * angle_len) * radius * 0.75; // 2 n // 1 /| / | m -- cgit v1.2.3