Skip to content
Snippets Groups Projects
Select Git revision
  • b65d549e64438eb06c4bd4a09efde7f41ded698b
  • master default
  • mingw_gcc44
  • release_ABP1_012
  • release_ABP1_008
  • release_ABP1_006
  • release_ABP1_007
  • release_ABP1_005
  • release_ABP1_004
  • release_ABP1_003
  • pre_release_0.15
  • release_ABP1_001
  • release_ABP1_002
  • pre_release_0.13
  • pre_release_0.14
  • pre_release_0.11
  • pre_release_0.12
  • pre_release_0.10
  • pre_release_0.09
  • pre_release_0.08
20 results

Starsphere.cpp

Blame
  • Forked from einsteinathome / graphicsframework
    Source project has a limited visibility.
    Starsphere.cpp 23.02 KiB
    #include "Starsphere.h"
    
    Starsphere::Starsphere() : AbstractGraphicsEngine()
    {
    	Axes=0, Stars=0, Constellations=0, Pulsars=0;
    	LLOmarker=0, LHOmarker=0, GEOmarker=0;
    	sphGrid=0, SNRs=0, SearchMarker=0;
    
    	/**
    	 * Parameters and State info
    	 */
    	sphRadius = 5.5;
    	featureFlags = 0;
    
    	/**
    	 * Viewpoint (can be changed with mouse)
    	 */
    	viewpt_azimuth = 30.0;
    	viewpt_elev = 23.6;
    	viewpt_radius = 7.6;
    
    	wobble_amp = 37.0;
    	wobble_period = 17.0;
    	zoom_amp = 0.00;
    	zoom_period = 29.0;
    
    	rotation_offset = 0.0;
    	rotation_speed = 180.0;
    	
    	m_RefreshSearchMarker = true;
    }
    
    Starsphere::~Starsphere()
    {
    	if(m_PolygonFont) delete m_PolygonFont;
    }
    
    /**
     * sphVertex3D() creates a GL vertex in 3D sky sphere coordinates
     * sphVertex() creates a GL vertex on the surface of the sky sphere.
     * Use either like glVertex().
     */
    void Starsphere::sphVertex3D(GLfloat RAdeg, GLfloat DEdeg, GLfloat radius)
    {
    	GLfloat x, y, z;
    
    	x = radius * COS(DEdeg) * COS(RAdeg);
    	z = -radius * COS(DEdeg) * SIN(RAdeg);
    	y = radius * SIN(DEdeg);
    	glVertex3f(x, y, z);
    	return;
    }
    
    void Starsphere::sphVertex(GLfloat RAdeg, GLfloat DEdeg)
    {
    	sphVertex3D(RAdeg, DEdeg, sphRadius);
    }
    
    /**
     * Star Marker:
     * Makes a marker for one star at a given position and angular size.  
     */
    void Starsphere::star_marker(float RAdeg, float DEdeg, float size)
    {
    	glPointSize((GLfloat) size);
    	glBegin(GL_POINTS);
    	sphVertex((GLfloat) RAdeg, (GLfloat) DEdeg);
    	glEnd();
    	return;
    }