float const centerLat=m_planetAxis.pitch(); float const centerLng=-m_planetAxis.yaw(); double PiRestriction = 5 * M_PI / 6; bool flag = false; int lastSign =0; ScreenPolygon otherPolygon; otherPolygon.setClosed( m_polygon.closed() ); double xyFactor = (float)(2*m_radius)/M_PI; double degX; double degY; qpos = itPoint->quaternion(); qpos.getSpherical(degX,degY); double x = m_imgwidth/2 + xyFactor * (degX + centerLng); double y = m_imgheight/2 + xyFactor * (degY + centerLat); m_currentPoint = QPointF( x, y ); int sign = (int) (degX / fabs(degX) ); if( sign != lastSign && fabs(degX) > PiRestriction ) { flag = !flag; } if( !flag ) m_polygon<= 2 ) { append(m_polygon); } if( otherPolygon.size() >=2 ) { append(otherPolygon); }