From f806ba745d324ace8fb054a4c097e924e73879c2 Mon Sep 17 00:00:00 2001 From: Person Date: Thu, 16 Jan 2020 20:22:41 -0800 Subject: [PATCH] --User changes -Change how the PositiveYUp option is actually handled to make things more compatible with Apophysis. depending on the value of that option: --Moving an affine up or down will mean a positive or negative value. --Locally, the display of the affine will be flipped. --Bug fixes -Fix waffle. --- Source/Ember/Variations04.h | 4 +- Source/Fractorium/FractoriumXformsAffine.cpp | 4 +- Source/Fractorium/GLWidget.cpp | 43 +++----------------- 3 files changed, 10 insertions(+), 41 deletions(-) diff --git a/Source/Ember/Variations04.h b/Source/Ember/Variations04.h index 96cc31b..51ee84a 100644 --- a/Source/Ember/Variations04.h +++ b/Source/Ember/Variations04.h @@ -1792,8 +1792,8 @@ public: virtual void Precalc() override { - m_SinR = std::sin(m_Rotation); - m_CosR = std::cos(m_Rotation); + m_SinR = m_Weight * std::sin(m_Rotation); + m_CosR = m_Weight * std::cos(m_Rotation); } protected: diff --git a/Source/Fractorium/FractoriumXformsAffine.cpp b/Source/Fractorium/FractoriumXformsAffine.cpp index ab53e93..82d6e0d 100644 --- a/Source/Fractorium/FractoriumXformsAffine.cpp +++ b/Source/Fractorium/FractoriumXformsAffine.cpp @@ -456,7 +456,7 @@ void Fractorium::OnMoveUpButtonClicked(bool checked) double d = ToDouble(combo->currentText(), &ok); if (ok) - m_Controller->MoveXforms(0, d, pre); + m_Controller->MoveXforms(0, m_Settings->YAxisUp() ? d : -d, pre); } /// @@ -473,7 +473,7 @@ void Fractorium::OnMoveDownButtonClicked(bool checked) double d = ToDouble(combo->currentText(), &ok); if (ok) - m_Controller->MoveXforms(0, -d, pre); + m_Controller->MoveXforms(0, m_Settings->YAxisUp() ? -d : d, pre); } /// diff --git a/Source/Fractorium/GLWidget.cpp b/Source/Fractorium/GLWidget.cpp index e96c1cc..7b647db 100644 --- a/Source/Fractorium/GLWidget.cpp +++ b/Source/Fractorium/GLWidget.cpp @@ -34,42 +34,6 @@ "void main() {\n" " gl_FragColor = texture2D(quadtex, texcoord.st);\n" "}\n"; - - /* - static const char* vertexShaderSource = - "#version 120\n" - "in vec4 posattr;\n" - "uniform mat4 matrix;\n" - "void main() {\n" - " gl_Position = matrix * posattr;\n" - "}\n"; - - static const char* fragmentShaderSource = - "#version 120\n" - "uniform vec4 mycolor;\n" - "out vec4 fragout;" - "void main() {\n" - " fragout = mycolor;\n" - "}\n"; - - static const char* quadVertexShaderSource = - "#version 120\n" - "in vec4 posattr;\n" - "uniform mat4 matrix;\n" - "out vec4 texcoord;\n" - "void main() {\n" - " gl_Position = matrix * posattr;\n" - " texcoord = posattr;\n" - "}\n"; - - static const char* quadFragmentShaderSource = - "#version 120\n" - "uniform sampler2D quadtex;\n" - "in vec4 texcoord;\n" - "out vec4 fragout;" - "void main() {\n" - " fragout = texture(quadtex, texcoord.st);\n" - "}\n"; */ #endif /// @@ -585,7 +549,12 @@ void GLWidget::paintGL() #else m_Program->bind(); m_ProjMatrix.setToIdentity(); - m_ProjMatrix.ortho(-unitX, unitX, -unitY, unitY, -1, 1);//Projection matrix: OpenGL camera is always centered, just move the ember internally inside the renderer. + + if (!controller->Renderer()->YAxisUp()) + m_ProjMatrix.ortho(-unitX, unitX, unitY, -unitY, -1, 1);//Projection matrix: OpenGL camera is always centered, just move the ember internally inside the renderer. + else + m_ProjMatrix.ortho(-unitX, unitX, -unitY, unitY, -1, 1); + m_ModelViewMatrix.setToIdentity(); //this->DrawUnitSquare(); controller->GLController()->DrawAffines(pre, post);