Example #1
0
/**
 * draw_octahedron:
 * @solid: TRUE if the octahedron should be solid.
 *
 * Renders a octahedron centered at the modeling coordinates
 * origin with a radius of 1.0.
 *
 **/
void
draw_octahedron (gboolean solid)
{
  if (solid)
    octahedron (GL_TRIANGLES);
  else
    octahedron (GL_LINE_LOOP);
}
Example #2
0
void display()
{
   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
   glEnable(GL_DEPTH_TEST);
   glEnable(GL_CULL_FACE);

   glLoadIdentity();

   
   //view angle
   if (mode == 0) //rotation for ortho mode
   {
      glRotatef(ph, 1,0,0);
      glRotatef(th, 0,1,0);
      glScaled(0.4,0.4,0.4);
   }
   else if (mode == 1) //rotation for perspective mode
   {
      ex = Sin(-th)*Cos(ph)*8;
      ey = Sin(ph)*8;
      ez = Cos(-th)*Cos(ph)*8;

      gluLookAt(ex,ey,ez , 0,0,0 , 0,Cos(ph),0);
      //glScaled(0.3,0.3,0.3);
   }
   else //mode == 2              // rotation and movement for FP mode
   {                             // occur in keyboard & special
      vx = ex - Sin(th)*Cos(ph); // here we simply update
      vy = ey - Sin(ph);         // location of view target
      vz = ez - Cos(th)*Cos(ph);

      gluLookAt(ex,ey,ez , vx,vy,vz , 0,Cos(ph),0);
   }


   sphere(0, 0, 0, 1.5*r, 0.5); //Jupiter
   glPushMatrix();
   glRotated(r/2, 0,1,0);
   cube(1, 0, 0, r, 0.25); //IO
   glPopMatrix();
   glPushMatrix();
   glRotated(r/4, 0,1,0);
   octahedron(-2, 0, 0, 4.0/3.0*r, 0.25); //Europa
   glPopMatrix();
   glPushMatrix();
   glRotated(r/8, 0,1,0);
   dodecahedron(3, 0, 0, -1.125*r, 0.25); //Ganymede
   glPopMatrix();
   glPushMatrix();
   glRotated(r/18.4, 0,1,0);
   icosahedron(4, 0, 0, 0.75*r, 0.25); //Callisto
   glPopMatrix();

   r = glutGet(GLUT_ELAPSED_TIME)*rate;
   r = fmod(r, 360*24*18.4);
   glFlush();
   glutSwapBuffers();
}
void APIENTRY
glutSolidOctahedron(void)
{
  octahedron(GL_TRIANGLES);
}
/* CENTRY */
void APIENTRY
glutWireOctahedron(void)
{
  octahedron(GL_LINE_LOOP);
}
Example #5
0
void APIENTRY auxSolidOctahedron (GLdouble radius)
{
    GLdouble center[3] = {(GLdouble)0.0, (GLdouble)0.0, (GLdouble)0.0};

    octahedron (center, radius, GL_TRIANGLES);
}
Example #6
0
/*  Render wire frame or solid octahedra.  If no display list with
 *  the current model size exists, create a new display list.
 */
void APIENTRY auxWireOctahedron (GLdouble radius)
{
    GLdouble center[3] = {(GLdouble)0.0, (GLdouble)0.0, (GLdouble)0.0};

    octahedron (center, radius, GL_LINE_LOOP);
}
Example #7
0
std::vector<Manifold::Triangle> Manifold::octahedron(PointOfReferencePtr por) {
	return octahedron(por, 1.);
}
Example #8
0
void
glutSolidOctahedron(void)
{
  octahedron(GL_TRIANGLES);
}
Example #9
0
void
glutWireOctahedron(void)
{
  octahedron(GL_LINE_LOOP);
}