diff --git a/src/pulsaranimationwidget.cpp b/src/pulsaranimationwidget.cpp index 2f4851b9f6d5c75bbd3a61ba11183d871d51a92b..63786b6841d2e33b14c50e3061e3cab32b477150 100644 --- a/src/pulsaranimationwidget.cpp +++ b/src/pulsaranimationwidget.cpp @@ -209,22 +209,7 @@ void PulsarAnimationWidget::initializeGL() } // prepare and check beam texture - QImage beamTexture(":/textures/resources/texture_beam.png"); - if(beamTexture.width() != beamTexture.height()) { - qWarning() << msgShape.arg(tr("Beam")); - } - else { - double integer = 0.0; - double fraction = 0.0; - fraction = modf(log(beamTexture.width()) / log(2.0), &integer); - if(fraction > 0.0) { - qWarning() << msgPower.arg(tr("Beam")); - } - } - if(beamTexture.width() > maxTextureSize) { - qWarning() << msgSize.arg(tr("beam").arg(maxTextureSize).arg(maxTextureSize)); - beamTexture = beamTexture.scaled(maxTextureSize, maxTextureSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - } + QImage beamTexture(":/textures/resources/World-Map-7.jpg"); // bind textures m_backgroundTexture = bindTexture(backgroundTexture, GL_TEXTURE_2D, GL_RGBA); @@ -286,7 +271,7 @@ void PulsarAnimationWidget::paintGL() glLoadIdentity(); // draw backdrop (independent parallel projection) - glColor3f(0.5, 0.5, 0.5f); + glColor3f(1.0, 1.0, 1.0f); glTranslatef(0.0, 0.0, -501.0); // restore original state @@ -297,25 +282,25 @@ void PulsarAnimationWidget::paintGL() } glPopMatrix(); - // enable wireframe mode - glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); - // draw earth glPushMatrix(); + { + glRotatef(130, 0.0, 1.0, 0.0); + glPushMatrix(); { glRotatef(90, 1.0, 0.0, 0.0); + glRotatef(180, 1.0, 1.0, 0.0); + + // create texture coordinates and enable texturing + gluQuadricTexture(m_quadricPulsar, GL_TRUE); + glBindTexture(GL_TEXTURE_2D, m_beamTexture); + glEnable(GL_TEXTURE_2D); - // draw sphere, with proper lighting - glEnable(GL_LIGHTING); - glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat); - glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); gluSphere(m_quadricPulsar, m_pulsarRadius, 32, 32); - glDisable(GL_LIGHTING); } glPopMatrix(); - - // back to solid rendering - glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); + } + glPopMatrix(); // draw source glPushMatrix(); diff --git a/src/pulsatingscience.qrc b/src/pulsatingscience.qrc index cdaff055496e0da4586a2610104f6a43d3ebe40a..b087bd93c25d0aeb726052d825a0f7fcf564afed 100644 --- a/src/pulsatingscience.qrc +++ b/src/pulsatingscience.qrc @@ -15,5 +15,6 @@ <qresource prefix="/textures"> <file>resources/texture_background_carina.png</file> <file>resources/texture_beam.png</file> + <file>resources/World-Map-7.jpg</file> </qresource> </RCC> diff --git a/src/resources/World-Map-7.jpg b/src/resources/World-Map-7.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c56471518a105d4a9d837ce1a2efe3a4b8c5b26c Binary files /dev/null and b/src/resources/World-Map-7.jpg differ