Commit 5714a733 authored by Oliver Bock's avatar Oliver Bock

Added arrow head to line of sight

parent 8a053d63
......@@ -64,8 +64,9 @@ PulsarAnimationWidget::PulsarAnimationWidget(QWidget *parent) :
m_quadricPulsarConeRim1 = NULL;
m_quadricPulsarConeRim2 = NULL;
m_quadricLineOfSight = NULL;
m_quadricLineOfSightTop1 = NULL;
m_quadricLineOfSightTop2 = NULL;
m_quadricLineOfSightTop = NULL;
m_quadricLineOfSightCone = NULL;
m_quadricLineOfSightConeBase = NULL;
// initialize texture pointers
m_backgroundTexture = 0;
......@@ -113,8 +114,9 @@ PulsarAnimationWidget::~PulsarAnimationWidget()
if(m_quadricPulsarSpinAxisTop2) gluDeleteQuadric(m_quadricPulsarSpinAxisTop2);
if(m_quadricPulsarMagneticAxis) gluDeleteQuadric(m_quadricPulsarMagneticAxis);
if(m_quadricLineOfSight) gluDeleteQuadric(m_quadricLineOfSight);
if(m_quadricLineOfSightTop1) gluDeleteQuadric(m_quadricLineOfSightTop1);
if(m_quadricLineOfSightTop2) gluDeleteQuadric(m_quadricLineOfSightTop2);
if(m_quadricLineOfSightTop) gluDeleteQuadric(m_quadricLineOfSightTop);
if(m_quadricLineOfSightCone) gluDeleteQuadric(m_quadricLineOfSightCone);
if(m_quadricLineOfSightConeBase) gluDeleteQuadric(m_quadricLineOfSightConeBase);
if(m_backgroundTexture) deleteTexture(m_backgroundTexture);
}
......@@ -157,8 +159,9 @@ void PulsarAnimationWidget::initializeGL()
m_quadricPulsarSpinAxisTop2 = gluNewQuadric();
m_quadricPulsarMagneticAxis = gluNewQuadric();
m_quadricLineOfSight = gluNewQuadric();
m_quadricLineOfSightTop1 = gluNewQuadric();
m_quadricLineOfSightTop2 = gluNewQuadric();
m_quadricLineOfSightTop = gluNewQuadric();
m_quadricLineOfSightCone = gluNewQuadric();
m_quadricLineOfSightConeBase = gluNewQuadric();
gluQuadricNormals(m_quadricPulsar, GLU_SMOOTH);
gluQuadricNormals(m_quadricPulsarConeRim1, GLU_SMOOTH);
......@@ -168,9 +171,9 @@ void PulsarAnimationWidget::initializeGL()
gluQuadricNormals(m_quadricPulsarSpinAxisTop2, GLU_SMOOTH);
gluQuadricNormals(m_quadricPulsarMagneticAxis, GLU_SMOOTH);
gluQuadricNormals(m_quadricLineOfSight, GLU_SMOOTH);
gluQuadricNormals(m_quadricLineOfSightTop1, GLU_SMOOTH);
gluQuadricNormals(m_quadricLineOfSightTop2, GLU_SMOOTH);
gluQuadricNormals(m_quadricLineOfSightTop, GLU_SMOOTH);
gluQuadricNormals(m_quadricLineOfSightCone, GLU_SMOOTH);
gluQuadricNormals(m_quadricLineOfSightConeBase, GLU_SMOOTH);
// query max texture size (estimate)
GLint maxTextureSize;
......@@ -262,19 +265,25 @@ void PulsarAnimationWidget::paintGL()
glPushMatrix();
{
glTranslatef(0.0, 0.0, m_pulsarRadius);
gluCylinder(m_quadricLineOfSight, 0.025, 0.025, 4.01, 32, 1);
gluCylinder(m_quadricLineOfSightCone, 0, 0.1, 0.5, 32, 1);
}
glPopMatrix();
glPushMatrix();
{
glTranslatef(0.0, 0.0, m_pulsarRadius + 0.5);
gluDisk(m_quadricLineOfSightConeBase, 0, 0.1, 32, 8);
}
glPopMatrix();
glPushMatrix();
{
glTranslatef(0.0, 0.0, m_pulsarRadius - 0.01);
gluDisk(m_quadricLineOfSightTop1, 0, 0.025, 32, 8);
glTranslatef(0.0, 0.0, m_pulsarRadius + 0.5);
gluCylinder(m_quadricLineOfSight, 0.025, 0.025, 3.51, 32, 1);
}
glPopMatrix();
glPushMatrix();
{
glTranslatef(0.0, 0.0, 5.01);
gluDisk(m_quadricLineOfSightTop2, 0, 0.025, 32, 8);
glTranslatef(0.0, 0.0, m_pulsarRadius + 4.01);
gluDisk(m_quadricLineOfSightTop, 0, 0.025, 32, 8);
}
glPopMatrix();
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
......
......@@ -83,8 +83,9 @@ private:
GLUquadricObj *m_quadricPulsarSpinAxisTop2;
GLUquadricObj *m_quadricPulsarMagneticAxis;
GLUquadricObj *m_quadricLineOfSight;
GLUquadricObj *m_quadricLineOfSightTop1;
GLUquadricObj *m_quadricLineOfSightTop2;
GLUquadricObj *m_quadricLineOfSightTop;
GLUquadricObj *m_quadricLineOfSightCone;
GLUquadricObj *m_quadricLineOfSightConeBase;
GLuint m_backgroundTexture;
......
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