Skip to content
Snippets Groups Projects
Commit 2e189760 authored by Oliver Bock's avatar Oliver Bock
Browse files

Visualize the pulse as a flash seen by the observer

parent edec5a4f
Branches
Tags
No related merge requests found
......@@ -554,6 +554,14 @@ void PulsarAnimationWidget::paintGL()
renderText(10, 25, -100, QString::fromLocal8Bit("Copyright © 2009-2011"), font);
renderText(10, 10, -100, QString::fromLocal8Bit("Max-Planck-Insitut für Gravitationsphysik"), font);
// render pulse "flash"
int profileIndex = (int) round(m_pulsarRotationAngle);
profileIndex = profileIndex == 360 ? 0 : profileIndex;
GLfloat flashAlpha = m_pulseProfile[profileIndex];
glColor4f(1.0, 1.0, 0.0, 0.75 * flashAlpha);
glTranslatef(0.0, 0.0, -1.0);
glRectf(0.0, 0.0, width(), height());
// restore original state
glMatrixMode(GL_PROJECTION);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment