Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

glut_teapot.c File Reference

#include <GL/gl.h>
#include <GL/glut.h>

Go to the source code of this file.


Functions

void teapot (GLint grid, GLdouble scale, GLenum type)
void glutSolidTeapot (GLdouble scale)
void glutWireTeapot (GLdouble scale)

Variables

long patchdata [][16]
float cpdata [][3]
float tex [2][2][2]

Function Documentation

void glutSolidTeapot GLdouble    scale
 

Definition at line 196 of file glut_teapot.c.

References scale, and teapot().

00197 {
00198   teapot(14, scale, GL_FILL);
00199 }

void glutWireTeapot GLdouble    scale
 

Definition at line 202 of file glut_teapot.c.

References scale, and teapot().

00203 {
00204   teapot(10, scale, GL_LINE);
00205 }

void teapot GLint    grid,
GLdouble    scale,
GLenum    type
[static]
 

Definition at line 137 of file glut_teapot.c.

References cpdata, i, l, p, patchdata, q, r, scale, and tex.

Referenced by glutSolidTeapot(), and glutWireTeapot().

00138 {
00139   float p[4][4][3], q[4][4][3], r[4][4][3], s[4][4][3];
00140   long i, j, k, l;
00141 
00142   glPushAttrib(GL_ENABLE_BIT | GL_EVAL_BIT);
00143   glEnable(GL_AUTO_NORMAL);
00144   glEnable(GL_NORMALIZE);
00145   glEnable(GL_MAP2_VERTEX_3);
00146   glEnable(GL_MAP2_TEXTURE_COORD_2);
00147   glPushMatrix();
00148   glRotatef(270.0, 1.0, 0.0, 0.0);
00149   glScalef(0.5 * scale, 0.5 * scale, 0.5 * scale);
00150   glTranslatef(0.0, 0.0, -1.5);
00151   for (i = 0; i < 10; i++) {
00152     for (j = 0; j < 4; j++) {
00153       for (k = 0; k < 4; k++) {
00154         for (l = 0; l < 3; l++) {
00155           p[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l];
00156           q[j][k][l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l];
00157           if (l == 1)
00158             q[j][k][l] *= -1.0;
00159           if (i < 6) {
00160             r[j][k][l] =
00161               cpdata[patchdata[i][j * 4 + (3 - k)]][l];
00162             if (l == 0)
00163               r[j][k][l] *= -1.0;
00164             s[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l];
00165             if (l == 0)
00166               s[j][k][l] *= -1.0;
00167             if (l == 1)
00168               s[j][k][l] *= -1.0;
00169           }
00170         }
00171       }
00172     }
00173     glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2,
00174       &tex[0][0][0]);
00175     glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
00176       &p[0][0][0]);
00177     glMapGrid2f(grid, 0.0, 1.0, grid, 0.0, 1.0);
00178     glEvalMesh2(type, 0, grid, 0, grid);
00179     glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
00180       &q[0][0][0]);
00181     glEvalMesh2(type, 0, grid, 0, grid);
00182     if (i < 6) {
00183       glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
00184         &r[0][0][0]);
00185       glEvalMesh2(type, 0, grid, 0, grid);
00186       glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
00187         &s[0][0][0]);
00188       glEvalMesh2(type, 0, grid, 0, grid);
00189     }
00190   }
00191   glPopMatrix();
00192   glPopAttrib();
00193 }

Variable Documentation

float cpdata[][3]
 

Definition at line 83 of file glut_teapot.c.

Referenced by main(), PRIC_main(), RIC_ToCardiacPhase(), and teapot().

long patchdata[][16]
 

Initial value:

{
    
  {102, 103, 104, 105, 4, 5, 6, 7, 8, 9, 10, 11,
    12, 13, 14, 15},
    
  {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
    24, 25, 26, 27},
  {24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36,
    37, 38, 39, 40},
    
  {96, 96, 96, 96, 97, 98, 99, 100, 101, 101, 101,
    101, 0, 1, 2, 3,},
  {0, 1, 2, 3, 106, 107, 108, 109, 110, 111, 112,
    113, 114, 115, 116, 117},
    
  {118, 118, 118, 118, 124, 122, 119, 121, 123, 126,
    125, 120, 40, 39, 38, 37},
    
  {41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
    53, 54, 55, 56},
  {53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
    28, 65, 66, 67},
    
  {68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
    80, 81, 82, 83},
  {80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
    92, 93, 94, 95}
}
(c) Copyright 1993, Silicon Graphics, Inc.

ALL RIGHTS RESERVED

Permission to use, copy, modify, and distribute this software for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both the copyright notice and this permission notice appear in supporting documentation, and that the name of Silicon Graphics, Inc. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.

THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.

US Government Users Restricted Rights

Use, duplication, or disclosure by the Government is subject to restrictions set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or in similar or successor clauses in the FAR or the DOD or NASA FAR Supplement. Unpublished-- rights reserved under the copyright laws of the United States. Contractor/manufacturer is Silicon Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.

OpenGL(TM) is a trademark of Silicon Graphics, Inc.

Definition at line 53 of file glut_teapot.c.

Referenced by teapot().

float tex[2][2][2] [static]
 

Initial value:

{
  { {0, 0},
    {1, 0}},
  { {0, 1},
    {1, 1}}
}

Definition at line 128 of file glut_teapot.c.

Referenced by teapot().

 

Powered by Plone

This site conforms to the following standards: