• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            牽著老婆滿街逛

            嚴以律己,寬以待人. 三思而后行.
            GMail/GTalk: yanglinbo#google.com;
            MSN/Email: tx7do#yahoo.com.cn;
            QQ: 3 0 3 3 9 6 9 2 0 .

            SGI OpenGL Color Cube

            From:http://www.terrence.com/opengl/ccube/ccube.html
            OpenGL Color Cube
            // Name     : OpenGL Color Cube
            // Author   : Terrence Ma
            // Email    : terrence@terrence.com
            // Web      : http://www.terrence.com
            // Date     : 10/25/2001
            // Modified : Tutorial sample from Mesa3d.org (http://www.mesa3d.org)

            /*
             * Copyright (c) 1993-1997, 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(R) is a registered trademark of Silicon Graphics, Inc.
             
            */


            /*
             *  aapoly.c
             *  This program draws filled polygons with antialiased
             *  edges.  The special GL_SRC_ALPHA_SATURATE blending 
             *  function is used.
             *  Pressing the 't' key turns the antialiasing on and off.
             
            */

            #include 
            <GL/glut.h>
            #include 
            <stdlib.h>
            #include 
            <stdio.h>
            #include 
            <string.h>

            GLboolean polySmooth 
            = GL_TRUE;

            static void init(void)
            {
               glCullFace (GL_BACK);
               glEnable (GL_CULL_FACE);
               glBlendFunc (GL_SRC_ALPHA_SATURATE, GL_ONE);
               glClearColor (
            0.00.00.00.0);
            }


            #define NFACE 6
            #define NVERT 8
            void drawCube(GLdouble x0, GLdouble x1, GLdouble y0, GLdouble y1,
                    GLdouble z0, GLdouble z1)
            {
               
            static GLfloat v[8][3];
               
            static GLfloat c[8][4= {
                  
            {0.00.00.01.0}{1.00.00.01.0},
                  
            {0.01.00.01.0}{1.01.00.01.0},
                  
            {0.00.01.01.0}{1.00.01.01.0},
                  
            {0.01.01.01.0}{1.01.01.01.0}
               }
            ;

            /*  indices of front, top, left, bottom, right, back faces  */
               
            static GLubyte indices[NFACE][4= {
                  
            {4567}{2376}{0473},
                  
            {0154}{1562}{0321}
               }
            ;

               v[
            0][0= v[3][0= v[4][0= v[7][0= x0;
               v[
            1][0= v[2][0= v[5][0= v[6][0= x1;
               v[
            0][1= v[1][1= v[4][1= v[5][1= y0;
               v[
            2][1= v[3][1= v[6][1= v[7][1= y1;
               v[
            0][2= v[1][2= v[2][2= v[3][2= z0;
               v[
            4][2= v[5][2= v[6][2= v[7][2= z1;

            #ifdef GL_VERSION_1_1
               glEnableClientState (GL_VERTEX_ARRAY);
               glEnableClientState (GL_COLOR_ARRAY);
               glVertexPointer (
            3, GL_FLOAT, 0, v);
               glColorPointer (
            4, GL_FLOAT, 0, c);
               glDrawElements (GL_QUADS, NFACE
            *4, GL_UNSIGNED_BYTE, indices);
               glDisableClientState (GL_VERTEX_ARRAY);
               glDisableClientState (GL_COLOR_ARRAY);
            #else
               printf (
            "If this is GL Version 1.0, ");
               printf (
            "vertex arrays are not supported.\n");
               exit(
            1);
            #endif
            }


            /*  Note:  polygons must be drawn from front to back
             *  for proper blending.
             
            */

            void display(void)
            {
               
            if (polySmooth) {
                  glClear (GL_COLOR_BUFFER_BIT);
                  glEnable (GL_BLEND);
                  glEnable (GL_POLYGON_SMOOTH);
                  glDisable (GL_DEPTH_TEST);
               }

               
            else 
                  glClear (GL_COLOR_BUFFER_BIT 
            | GL_DEPTH_BUFFER_BIT);
                  glDisable (GL_BLEND);
                  glDisable (GL_POLYGON_SMOOTH);
                  glEnable (GL_DEPTH_TEST);
               }


               glPushMatrix ();
                  glTranslatef (
            0.00.0-8.0);    
                  glRotatef (
            30.01.00.00.0);
                  glRotatef (
            60.00.01.00.0); 
                  drawCube(
            -0.80.8-0.80.8-0.80.8);
               glPopMatrix ();

               glFlush ();
            }


            void reshape(int w, int h)
            {
               glViewport(
            00, (GLsizei) w, (GLsizei) h);
               glMatrixMode(GL_PROJECTION);
               glLoadIdentity();
               gluPerspective(
            30.0, (GLfloat) w/(GLfloat) h, 1.020.0);
               glMatrixMode(GL_MODELVIEW);
               glLoadIdentity();
            }


            /* ARGSUSED1 */
            void keyboard(unsigned char key, int x, int y)
            {
               
            switch (key) {
                  
            case 't':
                  
            case 'T':
                     polySmooth 
            = !polySmooth;
                     glutPostRedisplay();
                     
            break;
                  
            case 27:
                     exit(
            0);  /*  Escape key  */
                     
            break;
                  
            default:
                     
            break;
               }

            }


            /*  Main Loop
             
            */

            int main(int argc, char** argv)
            {
               glutInit(
            &argc, argv);
               glutInitDisplayMode (GLUT_SINGLE 
            | GLUT_RGB 
                                    
            | GLUT_ALPHA | GLUT_DEPTH);
               glutInitWindowSize(
            400400);
               glutCreateWindow(
            "OpenGL Color Cube");
               init ();
               glutReshapeFunc (reshape);
               glutKeyboardFunc (keyboard);
               glutDisplayFunc (display);
               glutMainLoop();
               
            return 0;
            }




             

            posted on 2007-04-11 08:51 楊粼波 閱讀(499) 評論(0)  編輯 收藏 引用

            久久99久久99精品免视看动漫| 久久精品成人| 狠狠色丁香久久婷婷综合蜜芽五月 | 欧美久久久久久精选9999| 成人久久综合网| 久久66热人妻偷产精品9| 伊人色综合久久天天人手人婷| 久久综合久久综合亚洲| 亚洲精品久久久www| 亚洲另类欧美综合久久图片区| 欧美午夜A∨大片久久 | 久久久久99精品成人片三人毛片| 久久国产V一级毛多内射| 91精品免费久久久久久久久| A级毛片无码久久精品免费| 久久综合综合久久97色| 精品国产热久久久福利| 精品国产青草久久久久福利 | 久久久久99精品成人片牛牛影视| 久久久久一本毛久久久| 国内精品久久久久影院亚洲| 久久国产色av免费看| 久久精品无码专区免费东京热 | 亚洲国产精品热久久| 久久精品国产黑森林| 久久久久久久久久久久久久| 国产69精品久久久久9999APGF | 久久精品国产99久久无毒不卡| 久久精品国产精品青草app| 久久久久一级精品亚洲国产成人综合AV区| 国产香蕉久久精品综合网| 久久久女人与动物群交毛片| 久久精品国产99久久久香蕉| 色综合久久综合中文综合网| 免费精品99久久国产综合精品| 久久综合视频网| 亚洲国产精品热久久| 综合网日日天干夜夜久久| 91精品婷婷国产综合久久| 少妇久久久久久久久久| 久久免费国产精品|