亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? r1.cpp

?? jhj kjhj jkljlk kljlksj lkjxclkj l xkc lxzk xcl kxl kcxklc lxckx ,xc,mx xclkxlkc ,mxc,mx, ,m,mxl
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/*      Steven Billington
        January 13, 2003
        May 26, 2003 - UPDATE
        RobotOGL.cpp
        rod@cprogramming.com

        The following program creates a window and then
        uses multiple OpenGL functions to display a
        animated robot constructed of different size
        cubes. To compile this code you must make the
        proper library links in project--->settings.

        I apologize for any amount of scatterd code or
        mis-formatting that printing this may occur. Please
        feel free to email me at the address above for the .cpp
        file.
*/

/*      These are what we refer to as Pre-processor
        Directives. In order for certain functions in
        C++ to operate you must include certain header
        files. Each header file below contains different
        functions needed throughout this program.
*/

#pragma comment(linker, "/subsystem:windows")

#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <gl/glaux.h>

/*      Here we find a few global variables. While
        i don't really like to use global variables,
        i found them very handy for this particular
        program. These variables will control angles,
        fullscreen, and the global device context.
*/

HDC g_HDC;
float angle = 0.0f;
float legAngle[2] = {0.0f, 0.0f};
float armAngle[2] = {0.0f, 0.0f};
bool fullScreen = false;

/*      Function:       DrawCube
        Purpose:        As the name would suggest, this is
                                the function for drawing the cubes.
*/

void DrawCube(float xPos, float yPos, float zPos)
{
        glPushMatrix();
        glBegin(GL_POLYGON);

                /*      This is the top face*/
                glVertex3f(0.0f, 0.0f, 0.0f);
                glVertex3f(0.0f, 0.0f, -1.0f);
                glVertex3f(-1.0f, 0.0f, -1.0f);
                glVertex3f(-1.0f, 0.0f, 0.0f);

                /*      This is the front face*/
                glVertex3f(0.0f, 0.0f, 0.0f);
                glVertex3f(-1.0f, 0.0f, 0.0f);
                glVertex3f(-1.0f, -1.0f, 0.0f);
                glVertex3f(0.0f, -1.0f, 0.0f);

                /*      This is the right face*/
                glVertex3f(0.0f, 0.0f, 0.0f);
                glVertex3f(0.0f, -1.0f, 0.0f);
                glVertex3f(0.0f, -1.0f, -1.0f);
                glVertex3f(0.0f, 0.0f, -1.0f);

                /*      This is the left face*/
                glVertex3f(-1.0f, 0.0f, 0.0f);
                glVertex3f(-1.0f, 0.0f, -1.0f);
                glVertex3f(-1.0f, -1.0f, -1.0f);
                glVertex3f(-1.0f, -1.0f, 0.0f);

                /*      This is the bottom face*/
                glVertex3f(0.0f, 0.0f, 0.0f);
                glVertex3f(0.0f, -1.0f, -1.0f);
                glVertex3f(-1.0f, -1.0f, -1.0f);
                glVertex3f(-1.0f, -1.0f, 0.0f);

                /*      This is the back face*/
                glVertex3f(0.0f, 0.0f, 0.0f);
                glVertex3f(-1.0f, 0.0f, -1.0f);
                glVertex3f(-1.0f, -1.0f, -1.0f);
                glVertex3f(0.0f, -1.0f, -1.0f);

        glEnd();
        glPopMatrix();
}

/*      Function:       DrawArm
        Purpose:        This function draws the arm
                                for the robot.
*/

void DrawArm(float xPos, float yPos, float zPos)
{
        glPushMatrix();

                /*      Sets color to red*/
                glColor3f(1.0f, 0.0f, 0.0f);
                glTranslatef(xPos, yPos, zPos);

                /*      Creates 1 x 4 x 1 cube*/
                glScalef(1.0f, 4.0f, 1.0f);
                DrawCube(0.0f, 0.0f, 0.0f);

        glPopMatrix();
}

/*      Function:       DrawHead
        Purpose:        This function will create the
                                head for the robot.
*/

void DrawHead(float xPos, float yPos, float zPos)
{
        glPushMatrix();

                /*      Sets color to white*/
                glColor3f(1.0f, 1.0f, 1.0f);
                glTranslatef(xPos, yPos, zPos);

                /*      Creates 2 x 2 x 2 cube*/
                glScalef(2.0f, 2.0f, 2.0f);
                DrawCube(0.0f, 0.0f, 0.0f);

        glPopMatrix();
}

/*      Function:       DrawTorso
        Purpose:        Function will do as suggested
                                and draw a torso for our robot.
*/

void DrawTorso(float xPos, float yPos, float zPos)
{
        glPushMatrix();

                /*      Sets color to blue*/
                glColor3f(0.0f, 0.0f, 1.0f);
                glTranslatef(xPos, yPos, zPos);

                /*      Creates 3 x 5 x 1 cube*/
                glScalef(3.0f, 5.0f, 1.0f);
                DrawCube(0.0f, 0.0f, 0.0f);

        glPopMatrix();
}

/*      Function:       DrawLeg
        Purpose:        Not to sound repetitve, but as suggested
                                this function will draw our robots legs.
*/

void DrawLeg(float xPos, float yPos, float zPos)
{
        glPushMatrix();

                /*      Sets color to yellow*/
                glColor3f(1.0f, 1.0f, 0.0f);
                glTranslatef(xPos, yPos, zPos);

                /*      Creates 1 x 5 x 1 cube*/
                glScalef(1.0f, 5.0f, 1.0f);
                DrawCube(0.0f, 0.0f, 0.0f);

        glPopMatrix();
}

/*      Function:       DrawRobot
        Purpose:        Function to draw our entire robot
*/

void DrawRobot(float xPos, float yPos, float zPos)
{
        /*      Variables for state of robots legs. True
                means the leg is forward, and False means
                the leg is back. The same applies to the
                robots arm states.
        */
        static bool leg1 = true;
        static bool leg2 = false;
        static bool arm1 = true;
        static bool arm2 = false;

        glPushMatrix();

                /*      This will draw our robot at the
                        desired coordinates.
                */
                glTranslatef(xPos, yPos, zPos);

                /*      These three lines will draw the
                        various components of our robot.
                */
                DrawHead(1.0f, 2.0f, 0.0f);
                DrawTorso(1.5f, 0.0f, 0.0f);
                glPushMatrix();


                /*      If the arm is moving forward we will increase
                        the angle; otherwise, we will decrease the
                        angle.
                */
                if (arm1)
                {
                        armAngle[0] = armAngle[0] + 1.0f;
                }
                else
                {
                        armAngle[0] = armAngle[0] - 1.0f;
                }

                /*      Once the arm has reached its max angle
                        in one direction, we want it to reverse
                        and change direction.
                */
                if (armAngle[0] >= 15.0f)
                {
                        arm1 = false;
                }
                if (armAngle[0] <= 15.0f)
                {
                        arm1 = true;
                }


                /*      Here we are going to move the arm away
                        from the torso and rotate. This will
                        create a walking effect.
                */
                glTranslatef(0.0f, -0.5f, 0.0f);
                glRotatef(armAngle[0], 1.0f, 0.0f, 0.0f);
                DrawArm(2.5f, 0.0f, -0.5f);

        glPopMatrix();

        glPushMatrix();


                /*      If the arm is moving forward we will increase
                        the angle, otherwise we will decrease the
                        angle
                */
                if (arm2)
                {
                        armAngle[1] = armAngle[1] + 1.0f;
                }
                else
                {
                        armAngle[1] = armAngle[1] - 1.0f;
                }

                /*      Here we are going to move the arm away
                        from the torso and rotate. This will
                        create a walking effect.
                */
                glTranslatef(0.0f, -0.5f, 0.0f);
                glRotatef(armAngle[1], 1.0f, 0.0f, 0.0f);
                DrawArm(-1.5f, 0.0f, -0.5f);

        glPopMatrix();

        /*      Now its time to rotate the legs relative to the
                robots position in the world, this is the first
                leg, ie the right one.
        */
        glPushMatrix();

                /*      If the leg is moving forward we will increase
                        the angle; otherwise, we will decrease the
                        angle.
                */
                if (leg1)
                {
                        legAngle[0] = legAngle[0] + 1.0f;
                }
                else
                {
                        legAngle[0] = legAngle[0] - 1.0f;
                }

                /*      Once the leg has reached its max angle
                        in one direction, we want it to reverse
                        and change direction.
                */
                if (legAngle[0] >= 15.0f)
                {
                        leg1 = false;
                }
                if (legAngle[0] <= -15.0f)
                {
                        leg1 = true;
                }


                /*      Here we are going to move the leg away
                        from the torso and rotate. This will
                        create a walking effect.
                */
                glTranslatef(0.0f, -0.5f, 0.0f);
                glRotatef(legAngle[0], 1.0f, 0.0f, 0.0f);


                /*      Time to draw the leg.
                */
                DrawLeg(-0.5f, -5.0f, -0.5f);

        glPopMatrix();

        /*      Same as above, for the left leg.
        */
        glPushMatrix();

                /*      If the leg is moving forward we will increase
                        the angle, otherwise we will decrease the
                        angle
                */
                if (leg2)
                {
                        legAngle[1] = legAngle[1] + 1.0f;
                }
                else
                {
                        legAngle[1] = legAngle[1] - 1.0f;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品女同一区二区| 国产精品素人视频| 成人国产精品免费观看动漫| 一区二区三区国产精品| 26uuu精品一区二区 | 91免费在线看| 久热成人在线视频| 一区二区三区四区蜜桃| 国产午夜精品一区二区三区视频 | 国产电影一区二区三区| 亚洲成人精品在线观看| 中文字幕一区二区三区不卡在线| 欧美一级欧美三级在线观看 | hitomi一区二区三区精品| 蜜桃91丨九色丨蝌蚪91桃色| 亚洲码国产岛国毛片在线| 国产日韩av一区| 日韩欧美精品三级| 亚洲天堂成人网| 精品久久国产老人久久综合| 欧美人伦禁忌dvd放荡欲情| 91麻豆福利精品推荐| 成人性色生活片| 国产乱淫av一区二区三区 | 一区二区三区国产精品| 国产精品免费久久久久| 久久久99免费| 久久久蜜桃精品| 精品区一区二区| 91精品国产综合久久精品麻豆| 欧美性猛交一区二区三区精品| 成人美女视频在线看| 粉嫩一区二区三区性色av| 国产呦精品一区二区三区网站| 日本不卡1234视频| 青青草97国产精品免费观看| 日韩和的一区二区| 午夜精品免费在线观看| 丝袜诱惑制服诱惑色一区在线观看| 亚洲综合丝袜美腿| 一区二区在线免费| 一区二区三区久久久| 亚洲乱码中文字幕| 亚洲国产视频在线| 亚洲第一主播视频| 日韩av一区二区三区| 免费成人美女在线观看.| 蜜桃一区二区三区在线| 久久精品国产一区二区| 国产一区二区h| 国产成人aaa| 91色九色蝌蚪| 欧美视频一区二区三区在线观看 | 亚洲色图丝袜美腿| 一区二区三区在线观看网站| 亚洲一区二区欧美| 日日骚欧美日韩| 黄色日韩网站视频| 丁香亚洲综合激情啪啪综合| 99精品国产99久久久久久白柏| 色婷婷激情一区二区三区| 欧美午夜一区二区| 日韩欧美国产一区二区三区| 久久午夜免费电影| 国产精品国产a| 亚洲国产成人av好男人在线观看| 日本午夜一本久久久综合| 久久99国产精品久久99果冻传媒| 国产寡妇亲子伦一区二区| 91一区在线观看| 欧美日韩国产免费一区二区| 亚洲精品一线二线三线| 国产精品久线在线观看| 亚洲成人一区二区在线观看| 久久99精品国产.久久久久久| 国产a视频精品免费观看| 在线免费视频一区二区| 欧美变态口味重另类| 国产精品久久久久久久久免费桃花| 一区二区在线免费| 国内成人精品2018免费看| 久久在线免费观看| 香蕉av福利精品导航| 美女免费视频一区二区| 蜜乳av一区二区三区| 国产在线精品一区二区| 一本一道久久a久久精品 | www国产亚洲精品久久麻豆| 亚洲三级理论片| 久久国产人妖系列| 色哦色哦哦色天天综合| 精品国产伦一区二区三区观看体验| 中文字幕一区二区三区在线不卡 | 亚洲福利视频一区| 国产麻豆成人精品| 欧美日韩mp4| 国产精品久久久一本精品| 日韩电影在线一区| 中文字幕国产一区二区| 午夜精品久久久久久久蜜桃app| 成人久久久精品乱码一区二区三区 | 日韩一区二区三区av| 亚洲欧美日韩一区| 国产宾馆实践打屁股91| 欧美一区二区视频在线观看2020 | 老鸭窝一区二区久久精品| 色哟哟一区二区在线观看| 久久一夜天堂av一区二区三区| 午夜不卡在线视频| 99久久99久久精品免费看蜜桃| 久久综合av免费| 日本成人在线电影网| 欧美性猛片aaaaaaa做受| 国产精品高清亚洲| 福利一区二区在线观看| 精品国产髙清在线看国产毛片| 亚洲成人精品一区| 91豆麻精品91久久久久久| 国产精品白丝在线| 成人国产免费视频| 国产亚洲欧美在线| 韩国女主播成人在线观看| 这里只有精品99re| 偷拍一区二区三区| 欧美午夜一区二区三区免费大片| 中文字幕一区av| 成人国产视频在线观看| 国产日本欧美一区二区| 久久成人羞羞网站| 欧美成人福利视频| 免费欧美在线视频| 欧美一区二区免费| 日韩av网站在线观看| 这里只有精品99re| 秋霞成人午夜伦在线观看| 欧美一区二区三区在线电影| 三级成人在线视频| 91精品国产综合久久精品| 日韩国产高清在线| 日韩欧美国产高清| 精品一区二区日韩| 国产欧美日韩另类视频免费观看 | 成人国产精品免费| 亚洲欧洲一区二区在线播放| av色综合久久天堂av综合| 最新日韩av在线| 在线观看日韩av先锋影音电影院| 一区二区三区中文在线| 欧美亚洲动漫另类| 日韩精品亚洲一区| 欧美zozozo| 大尺度一区二区| 亚洲欧美日韩国产综合| 欧美亚洲高清一区| 麻豆久久一区二区| 国产亚洲一区字幕| 91麻豆swag| 午夜精品久久久久久不卡8050| 日韩一区二区电影网| 国内不卡的二区三区中文字幕| 欧美—级在线免费片| 91免费版在线| 日韩成人一级大片| 久久久久久久久久久99999| 91美女视频网站| 天天综合日日夜夜精品| 精品成人a区在线观看| 成人美女视频在线观看| 亚洲高清三级视频| 久久久久久亚洲综合| 97精品视频在线观看自产线路二| 亚洲成a人片在线观看中文| 精品久久一二三区| 91视频在线看| 免费成人av在线播放| 国产精品视频观看| 欧美猛男男办公室激情| 国产久卡久卡久卡久卡视频精品| 中文字幕五月欧美| 欧美一区二区观看视频| eeuss鲁片一区二区三区| 天天av天天翘天天综合网| 久久久久久久电影| 欧美日韩亚洲综合一区| 风间由美一区二区av101| 亚洲成人免费电影| 国产精品乱码妇女bbbb| 日韩写真欧美这视频| 色综合久久中文综合久久牛| 老鸭窝一区二区久久精品| 亚洲欧洲日韩一区二区三区| 欧美一区二区三区在线视频| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 国产精品一区二区三区网站| 一二三四社区欧美黄| 国产女人18毛片水真多成人如厕| 欧美色区777第一页| 成人av在线资源| 精品伊人久久久久7777人| 亚洲国产sm捆绑调教视频|