gluDisk() public static method

public static gluDisk ( IntPtr qobj, double innerRadius, double outerRadius, int slices, int loops ) : void
qobj System.IntPtr
innerRadius double
outerRadius double
slices int
loops int
return void
Exemplo n.º 1
0
        public void CreateRobotList()
        {
            GL.glPushMatrix();
            //
            // hierarchical list
            //
            GL.glNewList(ROBOT_LIST, GL.GL_COMPILE);

            // BASE : no rotations!!! Angle will be implemented in the CALL routine
            //                   before call to CreateRobotList()
            GL.glColor3f(0, 0, 0.5f);
            GLU.gluCylinder(obj, 3 * r, 3 * r, r * 1.2, 40, 20);
            GL.glTranslated(0, 0, r * 1.2);
            GLU.gluDisk(obj, 0, 3 * r, 40, 20);
            GL.glColor3f(0, 0, 1);
            GLU.gluSphere(obj, r * 1.2, 20, 20);
            // end base

            // transformations
            GL.glRotatef(SHOULDER_angle, 1, 0, 0);

            // call SHOULDER
            GL.glCallList(SHOULDER_LIST);

            // transformations
            //no need in glTranslated 0, 0, SHOULDER_length
            //it is located properly now !!!
            GL.glRotatef(ARM_angle, 1, 0, 0);

            // call ARM
            GL.glCallList(ARM_LIST);
            GL.glEndList();
            GL.glPopMatrix();
        }
Exemplo n.º 2
0
        public void Drawlake()
        {
            float[] lake_ambuse = { 0.0117f, 0.4296f, 0.6562f, 0.3f };
            GL.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT_AND_DIFFUSE, lake_ambuse);

            for (int ll = 0; ll < 6; ll++)
            {
                GL.glPushMatrix();

                GL.glTranslated(160 - (ll * 70), 0, 0);
                GL.glColor4f(0.0117f, 0.4296f, 0.6562f, 0.5f);
                GL.glRotatef(90, 1, 0, 0);
                GLU.gluDisk(obj, 0, lake_size, 30, 30);// size of lake

                GL.glPopMatrix();
            }
        }
Exemplo n.º 3
0
 void drawLake()
 {
     GL.glEnable(GL.GL_LIGHTING);
     GL.glCallList(WATER_MAT);
     GL.glPushMatrix();
     if (ScrollValue[16] >= 0)
     {
         GL.glScaled(1, 1, 1 + ScrollValue[16]);
     }
     else
     {
         GL.glScaled(1 + ScrollValue[16], 1, 1);
     }
     GL.glTranslated(ScrollValue[12], 0, ScrollValue[13]);
     GL.glRotated(90, 1, 0, 0);
     GLU.gluDisk(obj, 0, ScrollValue[14], 30, 30);
     GL.glPopMatrix();
     GL.glDisable(GL.GL_LIGHTING);
 }
Exemplo n.º 4
0
        void PrepareLists()
        {
            float ARM_length, SHOULDER_length;

            ARM_length      = 2;
            ARM_angle       = -45;
            SHOULDER_length = 2.5f;
            SHOULDER_angle  = 10;
            ROBOT_angle     = 45;
            r = 0.3f;

            ROBOT_LIST    = GL.glGenLists(3);
            ARM_LIST      = ROBOT_LIST + 1;
            SHOULDER_LIST = ROBOT_LIST + 2;

            GL.glPushMatrix();
            GL.glNewList(ARM_LIST, GL.GL_COMPILE);
            //cone
            GL.glColor3f(0.5f, 0, 0);
            GLU.gluCylinder(obj, r, 0, ARM_length, 20, 20);
            GL.glTranslated(0, 0, ARM_length);
            //internal disk
            GL.glColor3f(1, 1, 0);
            GLU.gluDisk(obj, 0, r * 0.5, 20, 20);
            //external disk
            GL.glColor3f(1, 0, 0);
            GLU.gluDisk(obj, r * 0.5, r * 1.5, 20, 20);
            GL.glEndList();
            GL.glPopMatrix();

            GL.glPushMatrix();
            GL.glNewList(SHOULDER_LIST, GL.GL_COMPILE);
            GL.glColor3f(0, 0.5f, 0);
            GLU.gluCylinder(obj, r, r, SHOULDER_length, 20, 20);
            GL.glTranslated(0, 0, SHOULDER_length);
            GL.glColor3f(0, 1, 0);
            GLU.gluSphere(obj, r * 1.2, 20, 20);
            GL.glEndList();
            GL.glPopMatrix();

            CreateRobotList();
        }
Exemplo n.º 5
0
        private void DrawDisk(double diskHeight, double diskRadius)
        {
            GL.glEnable(GL.GL_TEXTURE_2D);
            GL.glColor3f(1.0f, 1.0f, 1.0f);
            GL.glBindTexture(GL.GL_TEXTURE_2D, Textures[3]);

            GL.glPushMatrix();

            GLUquadric obj = GLU.gluNewQuadric();

            GLU.gluQuadricTexture(obj, 3);
            GLU.gluDisk(obj, 0, diskRadius, 60, 20);
            GLU.gluCylinder(obj, diskRadius, diskRadius, diskHeight, 32, 32);
            GL.glTranslatef(0.0f, 0.0f, (float)diskHeight);
            GLU.gluDisk(obj, 0, diskRadius, 60, 20);
            GL.glPopMatrix();
            // GL.glTranslatef(0.0f, 0.0f, -(float)diskHeight);

            GLU.gluDeleteQuadric(obj);

            GL.glDisable(GL.GL_TEXTURE_2D);
        }
Exemplo n.º 6
0
        public void DrawShadowHand(bool side)
        {
            GL.glPushMatrix();
            GL.glTranslated(0, 0, 0.23f);
            GL.glPushMatrix();
            if (side == false)
            {
                GL.glTranslatef(0, 0.6f, 0);
                if (WeaponIndex == 1 || WeaponIndex == 2)
                {
                    GL.glRotatef(ShoulderLeftAngle / 10, 0, 0, 1);
                    GL.glRotatef(WeaponPlace, 0, 0, 1);//hand Move from fire
                }
                else
                {
                    GL.glRotatef(-ShoulderLeftAngle, 0, 0, 1);
                }
                GL.glTranslatef(0, -0.6f, 0);
            }
            else
            {
                GL.glTranslatef(0, 0.6f, 0);
                if (WeaponIndex == 1 || WeaponIndex == 2)
                {
                    GL.glRotatef(-ShoulderRightAngle / 10, 0, 0, 1);
                    GL.glRotatef(WeaponPlace, 0, 0, 1);//hand Move from fire
                }
                else
                {
                    GL.glRotatef(-ShoulderRightAngle, 0, 0, 1);
                }
                GL.glTranslatef(0, -0.6f, 0);
            }

            GL.glTranslatef(0, 0.6f, 0.55f);
            GLU.gluCylinder(obj, radius, radius, radius * 1.2, 40, 20);
            GL.glTranslated(0, 0, radius * 1.2);
            GLU.gluDisk(obj, 0, radius, 40, 20);
            GLU.gluSphere(obj, radius * 1.2, 20, 20);
            GL.glTranslatef(0, -0.6f, -0.55f);

            // build Robot shoulder
            GL.glCallList(SHOULDER_SHADOW_LIST);
            GL.glRotatef(ArmLeftAngle, 1, 0, 0);

            //Move down hand with WeaponIndex
            if (WeaponIndex == 2)
            {
                GL.glRotatef(-WeaponPlace, 0, 1, 0);
                GL.glRotatef(WeaponPlace, 0, 0, 1);
            }

            // build Robot arm
            GL.glCallList(ARM_SHADOW_LIST);
            GL.glPopMatrix();

            if (IsMoving == false) //do not see bullets when walking
            {
                GL.glPushMatrix();
                if (WeaponIndex == 2)
                {
                    GL.glTranslatef(0.2f, 0.2f, 1.4f);
                    GL.glRotatef(-8, 0, 1, 0);
                }
                else//WeaponIndex 1
                {
                    GL.glTranslatef(2.2f, 1.4f, 1.3f);
                    GL.glRotatef(-8, 0, 1, 0);
                }

                GL.glRotatef(90, 0, 1, 0);
                GL.glTranslatef(0, 0, ShootDist);
                if (WeaponIndex == 1)
                {
                    //draw bullet
                    radius = radius * 2.2f;
                    GL.glColor3f(0.0f, 0.0f, 0);
                    GLU.gluCylinder(obj, radius / 4.5f, radius / 4.5f, radius / 2, 40, 20);
                    GLU.gluDisk(obj, 0, radius / 4.5f, 20, 20);
                    GL.glTranslatef(0, 0, radius / 2);
                    GLU.gluCylinder(obj, radius / 4.5f, 0, radius / 4, 40, 20);
                    radius = radius / 2.2f;
                }
                else if (WeaponIndex == 2)
                {
                    //draw bullet
                    GL.glColor3f(0.0f, 0.0f, 0);
                    GLU.gluCylinder(obj, radius / 1.3f, radius / 1.3f, radius * 7, 40, 20);
                    GLU.gluDisk(obj, 0, radius / 1.3f, 20, 20);
                    GL.glTranslatef(0, 0, radius * 7);
                    GLU.gluCylinder(obj, radius / 1.3f, 0, radius * 5, 40, 20);
                }
                GL.glPopMatrix();
            }
            GL.glPopMatrix();
        }
Exemplo n.º 7
0
        public void DrawRobot(bool isForShades)
        {
            GL.glPushMatrix();
            if (!isForShades)
            {
                GL.glColor4f(0f, 0f, 0.4f, 1f);
                GL.glEnable(GL.GL_COLOR_MATERIAL);
                GL.glMaterialf(GL.GL_FRONT_AND_BACK, GL.GL_SHININESS, 51.2f);
                GL.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT, chrome_ambient);
                GL.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_DIFFUSE, chrome_diffuse);
                GL.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_SPECULAR, chrome_specular);
            }

            GL.glTranslated(0, 0, 7.5);

            GL.glRotatef(180, 0, 1, 0);
            GL.glRotatef(-alfa, 0, 0, 1);
            GL.glTranslated(0, 0, updn);
            GL.glRotatef(bodyAngle, 0, 1, 0);
            GL.glPushMatrix();


            //torso
            if (isForShades)
            {
                GL.glColor3f(0.2f, 0.2f, 0.2f);
            }

            GLU.gluCylinder(obj, 1.0, 1.0, 4.0, 50, 3);
            GLU.gluDisk(obj, 0, 1, 40, 20);
            GL.glTranslated(0, 0, 4);
            GLU.gluDisk(obj, 0, 1, 40, 20);
            GL.glTranslated(0, 0, -4);
            //head
            GL.glTranslated(0, 0, -r * 3);
            GLU.gluSphere(obj, r * 3, 20, 20);

            GL.glPopMatrix();

            GL.glPushMatrix();
            //right_upper_ARM

            GL.glTranslated(0, 1.3, 0.3);

            GL.glRotatef(right_upper_ARM_yangle, 0, 1, 0);
            GL.glRotatef(right_upper_ARM_xangle, 1, 0, 0);
            if (!isForShades)
            {
                GL.glColor3f(0.4f, 0.6f, 0f);
            }
            else
            {
                GL.glColor3f(0.2f, 0.2f, 0.2f);
            }
            GLU.gluSphere(obj, r * 1.4, 20, 20);
            if (!isForShades)
            {
                GL.glColor3f(0, 0, 1f);
            }
            else
            {
                GL.glColor3f(0.2f, 0.2f, 0.2f);
            }
            GLU.gluCylinder(obj, 0.3, 0.3, 1.7, 50, 3);
            //right_lower_ARM
            GL.glTranslated(0, 0, 1.7);
            GL.glRotatef(right_lower_ARM_angle, 0, 1, 0);
            if (!isForShades)
            {
                GL.glColor3f(0.4f, 0.6f, 0f);
            }
            else
            {
                GL.glColor3f(0.2f, 0.2f, 0.2f);
            }
            GLU.gluSphere(obj, r * 1.1, 20, 20);
            if (!isForShades)
            {
                GL.glColor3f(0, 0, 1f);
            }
            else
            {
                GL.glColor3f(0.2f, 0.2f, 0.2f);
            }
            GLU.gluCylinder(obj, 0.3, 0.3, 1.7, 50, 3);

            GL.glPopMatrix();

            GL.glPushMatrix();

            //left_upper_ARM

            GL.glTranslated(0, -1.3, 0.3);
            GL.glRotatef(left_upper_ARM_yangle, 0, 1, 0);
            GL.glRotatef(left_upper_ARM_xangle, 1, 0, 0);
            if (!isForShades)
            {
                GL.glColor3f(0.4f, 0.6f, 0f);
            }
            else
            {
                GL.glColor3f(0.2f, 0.2f, 0.2f);
            }
            GLU.gluSphere(obj, r * 1.4, 20, 20);
            if (!isForShades)
            {
                GL.glColor3f(0, 0, 1f);
            }
            else
            {
                GL.glColor3f(0.2f, 0.2f, 0.2f);
            }
            GLU.gluCylinder(obj, 0.3, 0.3, 1.7, 50, 3);

            //left_lower_ARM

            /////
            GL.glTranslated(0, 0, 1.7);
            GL.glRotatef(left_lower_ARM_angle, 0, 1, 0);
            if (!isForShades)
            {
                GL.glColor3f(0.4f, 0.6f, 0f);
            }
            else
            {
                GL.glColor3f(0.2f, 0.2f, 0.2f);
            }
            GLU.gluSphere(obj, r * 1.1, 20, 20);
            if (!isForShades)
            {
                GL.glColor3f(0, 0, 1f);
            }
            else
            {
                GL.glColor3f(0.2f, 0.2f, 0.2f);
            }
            GLU.gluCylinder(obj, 0.3, 0.3, 1.7, 50, 3);

            GL.glPopMatrix();

            GL.glPushMatrix();

            //left_LEG

            GL.glTranslated(0, -0.7, 4.2);
            GL.glRotatef(right_upper_LEG_angle, 0, 1, 0);
            if (!isForShades)
            {
                GL.glColor3f(0.4f, 0.6f, 0f);
            }
            else
            {
                GL.glColor3f(0.2f, 0.2f, 0.2f);
            }
            GLU.gluSphere(obj, r * 1.5, 20, 20);
            if (!isForShades)
            {
                GL.glColor3f(0, 0, 1f);
            }
            else
            {
                GL.glColor3f(0.2f, 0.2f, 0.2f);
            }
            GLU.gluCylinder(obj, 0.3, 0.3, 1.7, 50, 3);
            GL.glTranslated(0, 0, 1.7);

            // right_lower_LEG

            GL.glRotatef(right_lower_LEG_angle, 0, 1, 0);
            if (!isForShades)
            {
                GL.glColor3f(0.4f, 0.6f, 0f);
            }
            else
            {
                GL.glColor3f(0.2f, 0.2f, 0.2f);
            }
            GLU.gluSphere(obj, r * 1.1, 20, 20);
            if (!isForShades)
            {
                GL.glColor3f(0, 0, 1f);
            }
            else
            {
                GL.glColor3f(0.2f, 0.2f, 0.2f);
            }
            GLU.gluCylinder(obj, 0.3, 0.3, 1.7, 50, 3);

            GL.glPopMatrix();

            GL.glPushMatrix();

            //right_LEG

            GL.glTranslated(0, 0.7, 4.2);
            GL.glRotatef(left_upper_LEG_angle, 0, 1, 0);
            if (!isForShades)
            {
                GL.glColor3f(0.4f, 0.6f, 0f);
            }
            else
            {
                GL.glColor3f(0.2f, 0.2f, 0.2f);
            }
            GLU.gluSphere(obj, r * 1.5, 20, 20);
            if (!isForShades)
            {
                GL.glColor3f(0, 0, 1f);
            }
            else
            {
                GL.glColor3f(0.2f, 0.2f, 0.2f);
            }
            GLU.gluCylinder(obj, 0.3, 0.3, 1.7, 50, 3);
            GL.glTranslated(0, 0, 1.7);
            //left_lower_LEG
            GL.glRotatef(left_lower_LEG_angle, 0, 1, 0);
            if (!isForShades)
            {
                GL.glColor3f(0.4f, 0.6f, 0f);
            }
            else
            {
                GL.glColor3f(0.2f, 0.2f, 0.2f);
            }
            GLU.gluSphere(obj, r * 1.1, 20, 20);
            if (!isForShades)
            {
                GL.glColor3f(0, 0, 1f);
            }
            else
            {
                GL.glColor3f(0.2f, 0.2f, 0.2f);
            }
            GLU.gluCylinder(obj, 0.3, 0.3, 1.7, 50, 3);

            GL.glPopMatrix();

            GL.glPopMatrix();
        }