diff --git a/src/pulsaranimationwidget.cpp b/src/pulsaranimationwidget.cpp index 77d4d8884076a9e76c7f526d58ae3dd2c76e6651..5dfa1e34efb520b2bb1a81fc9bf3614163e28d09 100644 --- a/src/pulsaranimationwidget.cpp +++ b/src/pulsaranimationwidget.cpp @@ -63,7 +63,6 @@ PulsarAnimationWidget::PulsarAnimationWidget(QWidget *parent) : m_quadricPulsarMagneticAxis = NULL; // initialize texture pointers - m_pulsarTexture = 0; m_backgroundTexture = 0; // initial render timing settings @@ -115,7 +114,6 @@ PulsarAnimationWidget::~PulsarAnimationWidget() if(m_quadricPulsarSpinAxis) gluDeleteQuadric(m_quadricPulsarSpinAxis); if(m_quadricPulsarMagneticAxis) gluDeleteQuadric(m_quadricPulsarMagneticAxis); - if(m_pulsarTexture) deleteTexture(m_pulsarTexture); if(m_backgroundTexture) deleteTexture(m_backgroundTexture); } @@ -177,24 +175,6 @@ void PulsarAnimationWidget::initializeGL() QString msgPower = tr("%1 texture dimensions not a power of 2!"); QString msgSize = tr("Maximum texture size exceeded! Scaling down %1 texture to %2x%3..."); - // prepare and check pulsar texture - QImage pulsarTexture(":/textures/resources/texture_pulsar.png"); - if(pulsarTexture.width() != pulsarTexture.height()) { - qWarning() << msgShape.arg(tr("Pulsar")); - } - else { - double integer = 0.0; - double fraction = 0.0; - fraction = modf(log(pulsarTexture.width()) / log(2.0), &integer); - if(fraction > 0.0) { - qWarning() << msgPower.arg(tr("Pulsar")); - } - } - if(pulsarTexture.width() > maxTextureSize) { - qWarning() << msgSize.arg(tr("pulsar").arg(maxTextureSize).arg(maxTextureSize)); - pulsarTexture = pulsarTexture.scaled(maxTextureSize, maxTextureSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - } - // prepare and check background texture QImage backgroundTexture(":/textures/resources/texture_background_carina.png"); if(backgroundTexture.width() != backgroundTexture.height()) { @@ -214,7 +194,6 @@ void PulsarAnimationWidget::initializeGL() } // bind textures - m_pulsarTexture = bindTexture(pulsarTexture, GL_TEXTURE_2D, GL_RGBA); m_backgroundTexture = bindTexture(backgroundTexture, GL_TEXTURE_2D, GL_RGBA); // use mipmapped textures @@ -284,33 +263,27 @@ void PulsarAnimationWidget::paintGL() { glRotatef(m_pulsarSpinAxisInclination, 0.0, 0.0, 1.0); glRotatef(m_pulsarRotationAngle, 0.0, 1.0, 0.0); + glRotatef(90, 0.0, 0.0, 0.0); // draw spin axis if(m_showRotationAxes) { glPushMatrix(); { glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, translucent); - glRotatef(90.0, 1.0, 0.0, 0.0); glTranslatef(0.0, 0.0, -5.0); gluCylinder(m_quadricPulsarSpinAxis, 0.05, 0.05, 10.0, 32, 1); + glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); } glPopMatrix(); } - // create texture coordinates and enable texturing - glEnable(GL_TEXTURE_GEN_S); - glEnable(GL_TEXTURE_GEN_T); - glBindTexture(GL_TEXTURE_2D, m_pulsarTexture); - glEnable(GL_TEXTURE_2D); - - glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat); - glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + // enable wireframe mode + glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); + // draw pulsar gluSphere(m_quadricPulsar, 1.0, 32, 32); - - // disable texturing - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - glDisable(GL_TEXTURE_2D); + // disable wireframe mode + glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); } glPopMatrix(); diff --git a/src/pulsaranimationwidget.h b/src/pulsaranimationwidget.h index 7a6a65e30d802454a6e3bd8e94e918b2a927b55f..c0a71cf0640050043cb6a337a56b9a7d51326afb 100644 --- a/src/pulsaranimationwidget.h +++ b/src/pulsaranimationwidget.h @@ -89,7 +89,6 @@ private: GLUquadricObj *m_quadricPulsarSpinAxis; GLUquadricObj *m_quadricPulsarMagneticAxis; - GLuint m_pulsarTexture; GLuint m_backgroundTexture; int m_framesPerSecond; diff --git a/src/pulsatingscience.qrc b/src/pulsatingscience.qrc index a809b9a3c569ad125465145afbdf9a0cfdc3eda7..9cf723b1effd0d73df9372fb08b88c27211f8f8f 100644 --- a/src/pulsatingscience.qrc +++ b/src/pulsatingscience.qrc @@ -1,19 +1,18 @@ <RCC> - <qresource prefix="icons" > - <file>resources/control-pause.png</file> - <file>resources/control-quit.png</file> - <file>resources/control-run.png</file> - <file>resources/control-stop.png</file> - <file>resources/help-about.png</file> - <file>resources/help-help.png</file> - <file>resources/help-website.png</file> - <file>resources/aei-icon48.png</file> - </qresource> - <qresource prefix="i18ns" > - <file>resources/pulsatingscience_de.qm</file> - </qresource> - <qresource prefix="textures" > - <file>resources/texture_background_carina.png</file> - <file>resources/texture_pulsar.png</file> - </qresource> + <qresource prefix="/icons"> + <file>resources/control-pause.png</file> + <file>resources/control-quit.png</file> + <file>resources/control-run.png</file> + <file>resources/control-stop.png</file> + <file>resources/help-about.png</file> + <file>resources/help-help.png</file> + <file>resources/help-website.png</file> + <file>resources/aei-icon48.png</file> + </qresource> + <qresource prefix="/i18ns"> + <file>resources/pulsatingscience_de.qm</file> + </qresource> + <qresource prefix="/textures"> + <file>resources/texture_background_carina.png</file> + </qresource> </RCC> diff --git a/src/resources/texture_pulsar.png b/src/resources/texture_pulsar.png deleted file mode 100644 index 379d228cece11ae0bc748b81e0babcdb136399eb..0000000000000000000000000000000000000000 Binary files a/src/resources/texture_pulsar.png and /dev/null differ