diff --git a/engines/freescape/gfx.cpp b/engines/freescape/gfx.cpp index 379ce4eecfa..311a37bda05 100644 --- a/engines/freescape/gfx.cpp +++ b/engines/freescape/gfx.cpp @@ -1002,9 +1002,9 @@ void Renderer::drawBackground(uint8 color) { void Renderer::drawEclipse(byte color1, byte color2, float progress) { Math::Vector3d sunPosition(-5000, 1200, 0); - float radius = 500.0; + float radius = 400.0; drawCelestialBody(sunPosition, radius, color1); - Math::Vector3d moonPosition(-5000, 1200, 0 + 500 * progress); + Math::Vector3d moonPosition(-5000, 1200, 800 * progress); drawCelestialBody(moonPosition, radius, color2); } diff --git a/engines/freescape/gfx_opengl.cpp b/engines/freescape/gfx_opengl.cpp index 6fbce92c63d..fb0b71d0db8 100644 --- a/engines/freescape/gfx_opengl.cpp +++ b/engines/freescape/gfx_opengl.cpp @@ -314,11 +314,12 @@ void OpenGLRenderer::drawCelestialBody(Math::Vector3d position, float radius, by glEnableClientState(GL_VERTEX_ARRAY); copyToVertexArray(0, position); + float adj = 1.25; // Perspective correction for(int i = 0; i <= triangleAmount; i++) { copyToVertexArray(i + 1, Math::Vector3d(position.x(), position.y() + (radius * cos(i * twicePi / triangleAmount)), - position.z() + (radius * sin(i * twicePi / triangleAmount))) + position.z() + (adj * radius * sin(i * twicePi / triangleAmount))) ); } @@ -336,7 +337,7 @@ void OpenGLRenderer::drawCelestialBody(Math::Vector3d position, float radius, by for(int i = 0; i <= triangleAmount; i++) { copyToVertexArray(i + 1, Math::Vector3d(position.x(), position.y() + (radius * cos(i * twicePi / triangleAmount)), - position.z() + (radius * sin(i * twicePi / triangleAmount))) + position.z() + (adj * radius * sin(i * twicePi / triangleAmount))) ); } diff --git a/engines/freescape/gfx_opengl_shaders.cpp b/engines/freescape/gfx_opengl_shaders.cpp index b4341b08a84..efcb92a79fd 100644 --- a/engines/freescape/gfx_opengl_shaders.cpp +++ b/engines/freescape/gfx_opengl_shaders.cpp @@ -304,6 +304,7 @@ void OpenGLShaderRenderer::drawCelestialBody(Math::Vector3d position, float radi int triangleAmount = 20; float twicePi = (float)(2.0 * M_PI); + float adj = 1.25; // Perspective correction // Quick billboard effect inspired from this code: // http://www.lighthouse3d.com/opengl/billboarding/index.php?billCheat @@ -332,7 +333,7 @@ void OpenGLShaderRenderer::drawCelestialBody(Math::Vector3d position, float radi for(int i = 0; i <= triangleAmount; i++) { float x = position.x(); float y = position.y() + (radius * cos(i * twicePi / triangleAmount)); - float z = position.z() + (radius * sin(i * twicePi / triangleAmount)); + float z = position.z() + (adj * radius * sin(i * twicePi / triangleAmount)); copyToVertexArray(i + 1, Math::Vector3d(x, y, z)); }