Пример #1
0
void display()
{

  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
  glLoadIdentity();
  gluLookAt(0, 0, 20 + zoomValue, 0, 0, 0, 0, 1, 0);

  // multiply current matrix with arcball matrix
  glMultMatrixf( arcball.get() );

  GLUquadric *sphere = gluNewQuadric(); 
  glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
   calculateFPS();
  _time_inter = diff_seconds();
  animateObject(); 
  //draw_sun();
    if (mode==0) {
      moebius();
      glutPostRedisplay();
    }
    else {
      glCallList(MOEBIUS);
      glutPostRedisplay();
    }
 
  drawFPS();
  glutPostRedisplay(); 
  glutSwapBuffers();
}
Пример #2
0
Polyhedron *
kaleido(char *sym, int need_coordinates, int need_edgelist, int need_approx,
	int just_list)
{
    Polyhedron *P;
/*
 * Allocate a Polyhedron structure P.
 */
    if (!(P = polyalloc()))
	return 0;
/*
 * Unpack input symbol into P.
 */
    if (!unpacksym(sym, P))
	return 0;
/*
 * Find Mebius triangle, its density and Euler characteristic.
 */
    if (!moebius(P))
	return 0;
/*
 * Decompose Schwarz triangle.
 */
    if (!decompose(P))
	return 0;
/*
 * Find the names of the polyhedron and its dual.
 */
    if (!guessname(P))
	return 0;
    if (just_list)
	return P;
/*
 * Solve Fundamental triangles, optionally printing approximations.
 */
    if (!newton(P,need_approx))
	return 0;
/*
 * Deal with exceptional polyhedra.
 */
    if (!exceptions(P))
	return 0;
/*
 * Count edges and faces, update density and characteristic if needed.
 */
    if (!count(P))
	return 0;
/*
 * Generate printable vertex configuration.
 */
    if (!configuration(P))
	return 0;
/*
 * Compute coordinates.
 */
    if (!need_coordinates && !need_edgelist)
	return P;
    if (!vertices(P))
	return 0;
    if (!faces (P))
	return 0;
/*
 * Compute edgelist.
 */
    if (!need_edgelist)
	return P;
    if (!edgelist(P))
	return 0;
    return P;
}
Пример #3
0
 int moebius(const num_t n) const {
   return moebius(this->factor(n));
 }