From 619ed1b90eb3ef6233166188b6a1c561f7410b8a Mon Sep 17 00:00:00 2001 From: Oliver Bock <oliver.bock@aei.mpg.de> Date: Sun, 11 Sep 2011 19:05:16 +0200 Subject: [PATCH] Nicer rotation axes (closed tops) --- src/pulsaranimationwidget.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/pulsaranimationwidget.cpp b/src/pulsaranimationwidget.cpp index 7dc8358..6399a2a 100644 --- a/src/pulsaranimationwidget.cpp +++ b/src/pulsaranimationwidget.cpp @@ -329,15 +329,27 @@ void PulsarAnimationWidget::paintGL() // draw spin axis if(m_showRotationAxes) { + glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); + glColor3f(1.0f, 1.0f, 1.0f); + glPushMatrix(); + { + glTranslatef(0.0, 0.0, -4.0); + gluCylinder(m_quadricPulsarSpinAxis, 0.020, 0.020, 8.0, 32, 1); + } + glPopMatrix(); glPushMatrix(); { - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, translucent); - 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); + glTranslatef(0.0, 0.0, -4.0); + gluDisk(m_quadricPulsarSpinAxisTop1, 0, 0.020, 32, 8); } glPopMatrix(); + glPushMatrix(); + { + glTranslatef(0.0, 0.0, 4.0); + gluDisk(m_quadricPulsarSpinAxisTop2, 0, 0.020, 32, 8); + } + glPopMatrix(); + glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); } // draw sphere, with proper lighting -- GitLab