Commit 032592bb authored by Oliver Bock's avatar Oliver Bock

Sent neutron star on same orbit as pulsar (and adjusted lights)

parent 21db0b15
...@@ -69,7 +69,7 @@ void PulsarAnimationWidget::initializeGL() ...@@ -69,7 +69,7 @@ void PulsarAnimationWidget::initializeGL()
glDepthFunc(GL_LEQUAL); glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
GLfloat LightAmbient[] = { 0.0f, 0.0f, 0.0f, 1.0f }; GLfloat LightAmbient[] = { 0.3f, 0.3f, 0.3f, 1.0f };
GLfloat LightDiffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f }; GLfloat LightDiffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f };
GLfloat LightSpecular[] = { 1.0f, 1.0f, 1.0f, 1.0f }; GLfloat LightSpecular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
GLfloat LightPosition[] = { 0.0f, 0.0f, 3.0f, 1.0f }; GLfloat LightPosition[] = { 0.0f, 0.0f, 3.0f, 1.0f };
...@@ -79,9 +79,9 @@ void PulsarAnimationWidget::initializeGL() ...@@ -79,9 +79,9 @@ void PulsarAnimationWidget::initializeGL()
glLightfv(GL_LIGHT0, GL_DIFFUSE, LightDiffuse); glLightfv(GL_LIGHT0, GL_DIFFUSE, LightDiffuse);
glLightfv(GL_LIGHT0, GL_SPECULAR, LightSpecular); glLightfv(GL_LIGHT0, GL_SPECULAR, LightSpecular);
glLightfv(GL_LIGHT0, GL_POSITION, LightPosition); glLightfv(GL_LIGHT0, GL_POSITION, LightPosition);
glLightf(GL_LIGHT0, GL_SPOT_CUTOFF, 20.0); glLightf(GL_LIGHT0, GL_SPOT_CUTOFF, 50.0);
glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, spot_direction); glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, spot_direction);
glLightf(GL_LIGHT0, GL_SPOT_EXPONENT, 5.0); glLightf(GL_LIGHT0, GL_SPOT_EXPONENT, 10.0);
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE); glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);
glEnable(GL_LIGHT0); glEnable(GL_LIGHT0);
...@@ -135,11 +135,13 @@ void PulsarAnimationWidget::paintGL() ...@@ -135,11 +135,13 @@ void PulsarAnimationWidget::paintGL()
glMaterialfv(GL_FRONT, GL_SHININESS, low_shininess); glMaterialfv(GL_FRONT, GL_SHININESS, low_shininess);
glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); glMaterialfv(GL_FRONT, GL_EMISSION, no_mat);
glRotatef(m_orbitRotationAngle, 0.0f, 1.0f, 0.0f);
glPushMatrix(); glPushMatrix();
glTranslatef(0.0f, 0.0f, m_orbitRadiusNeg);
gluSphere(m_quadricPulsar, 1.0f, 32, 32); gluSphere(m_quadricPulsar, 1.0f, 32, 32);
glPopMatrix(); glPopMatrix();
glRotatef(m_orbitRotationAngle, 0.0f, 1.0f, 0.0f);
glTranslatef(0.0f, 0.0f, m_orbitRadius); glTranslatef(0.0f, 0.0f, m_orbitRadius);
glPushMatrix(); glPushMatrix();
...@@ -271,7 +273,8 @@ void PulsarAnimationWidget::setPulsarSpinFrequency(const float frequency) ...@@ -271,7 +273,8 @@ void PulsarAnimationWidget::setPulsarSpinFrequency(const float frequency)
void PulsarAnimationWidget::setOrbitRadius(const float radius) void PulsarAnimationWidget::setOrbitRadius(const float radius)
{ {
m_orbitRadius = -1.0 * radius; m_orbitRadius = radius;
m_orbitRadiusNeg = -1.0 * radius;
} }
void PulsarAnimationWidget::setOrbitFrequency(const float frequency) void PulsarAnimationWidget::setOrbitFrequency(const float frequency)
......
...@@ -75,6 +75,7 @@ protected: ...@@ -75,6 +75,7 @@ protected:
float m_pulsarRotationAngle; float m_pulsarRotationAngle;
float m_orbitRadius; float m_orbitRadius;
float m_orbitRadiusNeg;
float m_orbitFrequency; float m_orbitFrequency;
float m_orbitRotationAngle; float m_orbitRotationAngle;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment