Commit 142c8c6c authored by Oliver Bock's avatar Oliver Bock
Browse files

Repurpose unused elements to build LHO (fixed position)

parent da11546c
......@@ -61,8 +61,8 @@ PulsarAnimationWidget::PulsarAnimationWidget(QWidget *parent) :
m_quadricPulsarCone2Shell = NULL;
m_quadricPulsarSpinAxis = NULL;
m_quadricPulsarSpinAxisTop1 = NULL;
m_quadricPulsarSpinAxisTop2 = NULL;
m_quadricPulsarMagneticAxis = NULL;
m_quadricLHOv = NULL;
m_quadricLHOh = NULL;
// initialize texture pointers
m_backgroundTexture = 0;
......@@ -122,8 +122,8 @@ PulsarAnimationWidget::~PulsarAnimationWidget()
if(m_quadricPulsarCone2Shell) gluDeleteQuadric(m_quadricPulsarCone2Shell);
if(m_quadricPulsarSpinAxis) gluDeleteQuadric(m_quadricPulsarSpinAxis);
if(m_quadricPulsarSpinAxisTop1) gluDeleteQuadric(m_quadricPulsarSpinAxisTop1);
if(m_quadricPulsarSpinAxisTop2) gluDeleteQuadric(m_quadricPulsarSpinAxisTop2);
if(m_quadricPulsarMagneticAxis) gluDeleteQuadric(m_quadricPulsarMagneticAxis);
if(m_quadricLHOv) gluDeleteQuadric(m_quadricLHOv);
if(m_quadricLHOh) gluDeleteQuadric(m_quadricLHOh);
if(m_backgroundTexture) deleteTexture(m_backgroundTexture);
if(m_beamTexture) deleteTexture(m_beamTexture);
......@@ -167,8 +167,8 @@ void PulsarAnimationWidget::initializeGL()
m_quadricPulsarCone2Shell = gluNewQuadric();
m_quadricPulsarSpinAxis = gluNewQuadric();
m_quadricPulsarSpinAxisTop1 = gluNewQuadric();
m_quadricPulsarSpinAxisTop2 = gluNewQuadric();
m_quadricPulsarMagneticAxis = gluNewQuadric();
m_quadricLHOv = gluNewQuadric();
m_quadricLHOh = gluNewQuadric();
gluQuadricNormals(m_quadricCompanionOrbitPlane, GLU_SMOOTH);
gluQuadricNormals(m_quadricCompanion, GLU_SMOOTH);
......@@ -178,8 +178,8 @@ void PulsarAnimationWidget::initializeGL()
gluQuadricNormals(m_quadricPulsarCone2Shell, GLU_SMOOTH);
gluQuadricNormals(m_quadricPulsarSpinAxis, GLU_SMOOTH);
gluQuadricNormals(m_quadricPulsarSpinAxisTop1, GLU_SMOOTH);
gluQuadricNormals(m_quadricPulsarSpinAxisTop2, GLU_SMOOTH);
gluQuadricNormals(m_quadricPulsarMagneticAxis, GLU_SMOOTH);
gluQuadricNormals(m_quadricLHOv, GLU_SMOOTH);
gluQuadricNormals(m_quadricLHOh, GLU_SMOOTH);
// query max texture size (estimate)
GLint maxTextureSize;
......@@ -302,6 +302,31 @@ void PulsarAnimationWidget::paintGL()
}
glPopMatrix();
// draw LHO
glPushMatrix();
{
glColor3f(1.0f, 1.0f, 1.0f);
glRotatef(-81, 1.0, 1.0, 0.0);
glTranslatef(0.0, 0.0, m_pulsarRadius);
glRotatef(180, 0.0, 0.0, 1.0);
glPushMatrix();
{
glRotatef(90, 0.0, 1.0, 0.0);
gluCylinder(m_quadricLHOh, 0.010, 0.010, 0.20, 32, 1);
}
glPopMatrix();
glPushMatrix();
{
glRotatef(90, 0.0, 1.0, 0.0);
glRotatef(90, 1.0, 0.0, 0.0);
gluCylinder(m_quadricLHOv, 0.010, 0.010, 0.20, 32, 1);
}
glPopMatrix();
}
glPopMatrix();
// draw source
glPushMatrix();
{
......@@ -331,13 +356,6 @@ void PulsarAnimationWidget::paintGL()
gluDisk(m_quadricPulsarSpinAxisTop1, 0, 0.020, 32, 8);
}
glPopMatrix();
glPushMatrix();
{
glTranslatef(0.0, 0.0, 0.5);
gluDisk(m_quadricPulsarSpinAxisTop2, 0, 0.020, 32, 8);
}
glPopMatrix();
glPushMatrix();
{
glTranslatef(0.0, 0.0, 0.5f);
......
......@@ -98,8 +98,8 @@ private:
GLUquadricObj *m_quadricPulsarCone2Shell;
GLUquadricObj *m_quadricPulsarSpinAxis;
GLUquadricObj *m_quadricPulsarSpinAxisTop1;
GLUquadricObj *m_quadricPulsarSpinAxisTop2;
GLUquadricObj *m_quadricPulsarMagneticAxis;
GLUquadricObj *m_quadricLHOv;
GLUquadricObj *m_quadricLHOh;
GLuint m_backgroundTexture;
GLuint m_beamTexture;
......
Supports Markdown
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