Bridge class to the glu32 dll. Provides constants and function definitions.
Exemple #1
0
        protected virtual void initRenderingGL()
        {
            if (m_uint_DC == 0 || m_uint_RC == 0)
            {
                return;
            }
            if (this.m_Width == 0 || this.m_Height == 0)
            {
                return;
            }
            GL.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
            GL.glEnable(GL.GL_DEPTH_TEST);
            GL.glDepthFunc(GL.GL_LEQUAL);

            GL.glViewport(0, 0, this.m_Width, this.m_Height);
            GL.glClearColor(0, 0, 0, 0);
            GL.glMatrixMode(GL.GL_PROJECTION);
            GL.glLoadIdentity();

            //1
            GLU.gluPerspective(45.0, ((double)m_Width) / m_Height, 1.0, 1000.0);
            //GLU.gluOrtho2D(0, Width, 0, Height);
            //the same
            //GLU.gluOrtho(0, iWidth, 0, iHeight, -1, 1);

            GL.glMatrixMode(GL.GL_MODELVIEW);
            GL.glLoadIdentity();

            InitTexture(Resources.dreidel);
        }
Exemple #2
0
        protected virtual void initRenderingGL()
        {
            if (m_uint_DC == 0 || m_uint_RC == 0)
            {
                return;
            }

            GL.glShadeModel(GL.GL_SMOOTH);
            GL.glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
            GL.glClearDepth(1.0f);

            GL.glEnable(GL.GL_LIGHT0);
            GL.glEnable(GL.GL_COLOR_MATERIAL);
            GL.glColorMaterial(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT_AND_DIFFUSE);

            GL.glEnable(GL.GL_DEPTH_TEST);
            GL.glDepthFunc(GL.GL_LEQUAL);
            GL.glHint(GL.GL_PERSPECTIVE_CORRECTION_Hint, GL.GL_NICEST);

            GL.glViewport(0, 0, Width, Height);
            GL.glClearColor(0, 0, 0, 0);
            GL.glMatrixMode(GL.GL_PROJECTION);
            GL.glLoadIdentity();
            GLU.gluPerspective(45.0, 1.0, 1.0, 1000.0);
            GL.glMatrixMode(GL.GL_MODELVIEW);
            GL.glLoadIdentity();
            GL.glGetDoublev(GL.GL_MODELVIEW_MATRIX, AccumulatedTraslations);

            InitTexture("SurgeryRoom.bmp");
        }
        public void draw_moon()
        {
            GL.glPushMatrix();

            GL.glColor3d(1, 1, 1);
            GL.glEnable(GL.GL_TEXTURE_2D);
            GL.glBindTexture(GL.GL_TEXTURE_2D, Textures[1]);


            quad = GLU.gluNewQuadric();
            GLU.gluQuadricTexture(quad, 40);


            GL.glTranslatef(-200, 200, -300);

            // rotating moon as well as all planets to Y axis
            GL.glTranslatef(0.0f + (float)speed * 0.01f, 0.0f, 0.0f);
            GL.glTranslatef(0.0f, 0.0f + (float)speed * 0.01f, 0.0f);

            GL.glRotatef((float)moon++ *0.5f, 1.0f, 1.0f, 0.0f);


            GLU.gluSphere(quad, 18, 200, 200);

            GL.glPopMatrix();
        }
Exemple #4
0
        protected virtual void initRenderingGL()
        {
            if (m_uint_DC == 0 || m_uint_RC == 0)
            {
                return;
            }
            if (this.Width == 0 || this.Height == 0)
            {
                return;
            }
            GL.glEnable(GL.GL_DEPTH_TEST);
            GL.glDepthFunc(GL.GL_LEQUAL);

            GL.glViewport(0, 0, Width, Height);
            GL.glClearColor(0, 0, 0, 0);
            GL.glMatrixMode(GL.GL_PROJECTION);
            GL.glLoadIdentity();
            double d = (Width) / Height;

            GLU.gluPerspective(100.0, (Width) / Height, 1.0, 1000.0);
            GL.glMatrixMode(GL.GL_MODELVIEW);
            GL.glLoadIdentity();

            InitTexture();
        }
Exemple #5
0
        public void initRenderingGL()
        {
            if (m_uint_DC == 0 || m_uint_RC == 0)
            {
                return;
            }
            if (this.Width == 0 || this.Height == 0)
            {
                return;
            }

            GL.glShadeModel(GL.GL_SMOOTH);
            GL.glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
            GL.glClearDepth(1.0f);

            GL.glEnable(GL.GL_LIGHT0);
            GL.glEnable(GL.GL_COLOR_MATERIAL);
            GL.glColorMaterial(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT_AND_DIFFUSE); // GL.GL_AMBIENT_AND_DIFFUSE / GL.GL_SHININESS


            //GL.glEnable(GL.GL_DEPTH_TEST);
            GL.glDepthFunc(GL.GL_LEQUAL);

            GL.glViewport(0, 0, this.Width, this.Height);
            GL.glMatrixMode(GL.GL_PROJECTION);
            GL.glLoadIdentity();

            GLU.gluPerspective(45, ((double)Width) / Height, 1.0, 1000.0);
            GL.glMatrixMode(GL.GL_MODELVIEW);
            //save the current MODELVIEW Matrix (now it is Identity)
            //GL.glGetDoublev(GL.GL_MODELVIEW_MATRIX, AccumulatedRotationsTraslations);

            InitTexture("IMG\\1.bmp");
        }
        public void draw_sun()
        {
            GL.glPushMatrix();
            GL.glColor3d(1, 1, 1);

            GL.glEnable(GL.GL_TEXTURE_2D);
            GL.glBindTexture(GL.GL_TEXTURE_2D, Textures[6]);


            quad = GLU.gluNewQuadric();
            GLU.gluQuadricTexture(quad, 40);

            GL.glTranslatef(pos[0], pos[1], pos[2]);

            // rotating sun as well as all planets to Y axis
            GL.glTranslatef(0.0f, 0.0f + (float)-speed * 0.03f, 0.0f);  //y - up down
            GL.glTranslatef(0.0f, 0.0f, 0.0f + (float)-speed * 0.01f);  //z - back forward

            GL.glRotatef((float)moon, 0.0f, 1.0f, 0.0f);

            GLU.gluSphere(quad, 45, 1000, 1000);



            GL.glPopMatrix();


            moon += 0.04f;
        }
Exemple #7
0
        private void DrawIsland()
        {
            float moveSphere = GlobalProperties.islandRadius - GlobalProperties.islandHeight;
            float rotate     = 45.0f;

            GL.glEnable(GL.GL_CLIP_PLANE0);
            double[] clipPalane0 = { 0.0, 0.0, 1.0, 0.0 };
            GL.glClipPlane(GL.GL_CLIP_PLANE0, clipPalane0);

            GL.glTranslatef(0.0f, 0.0f, -moveSphere);


            GL.glEnable(GL.GL_TEXTURE_2D);
            GL.glColor3f(1.0f, 1.0f, 1.0f);
            GL.glBindTexture(GL.GL_TEXTURE_2D, Textures[1]);


            GL.glRotatef(rotate, 1.0f, 1.0f, 0.0f);
            GLUquadric obj = GLU.gluNewQuadric();

            GLU.gluQuadricTexture(obj, 1);
            GLU.gluSphere(obj, GlobalProperties.islandRadius, 32, 32);
            GLU.gluDeleteQuadric(obj);
            GL.glRotatef(-rotate, 1.0f, 1.0f, 0.0f);

            GL.glDisable(GL.GL_TEXTURE_2D);

            GL.glTranslatef(0.0f, 0.0f, moveSphere);

            GL.glDisable(GL.GL_CLIP_PLANE0);
        }
Exemple #8
0
        protected virtual void initRenderingGL()
        {
            if (m_uint_DC == 0 || m_uint_RC == 0)
            {
                return;
            }
            if (this.Width == 0 || this.Height == 0)
            {
                return;
            }
            GL.glClearColor(0.5f, 0.9f, 1.0f, 1.0f);
            GL.glEnable(GL.GL_DEPTH_TEST);
            GL.glDepthFunc(GL.GL_LEQUAL);


            //GL.glHint(GL.GL_PERSPECTIVE_CORRECTION_Hint, GL.GL_NICEST);

            GL.glViewport(0, 0, this.Width, this.Height);
            GL.glMatrixMode(GL.GL_PROJECTION);
            GL.glLoadIdentity();


            GL.glShadeModel(GL.GL_SMOOTH);

            GLU.gluPerspective(60, (float)Width / (float)Height, 0.45f, 1000.0f);

            GenerateTextures(1);//////////////////////////////////////

            GL.glMatrixMode(GL.GL_MODELVIEW);
            GL.glLoadIdentity();
        }
Exemple #9
0
        public cOGL(Control pb)
        {
            p      = pb;
            Width  = p.Width;
            Height = p.Height;
            InitializeGL();
            obj = GLU.gluNewQuadric(); //!!!
            //3D model b1
            ch        = new Character("ninja.ms3d");
            ch1       = new Character("ninja.ms3d");
            isAnimate = false;
            isInside  = false;
            isBounds  = false;
            viewAngle = 45;
            Xangl     = 0;
            Yangl     = 0;
            Zangl     = 0;

            intOptionA = 1;

            ground[0, 0] = 1;
            ground[0, 1] = 1;
            ground[0, 2] = 0;

            ground[1, 0] = 0;
            ground[1, 1] = 1;
            ground[1, 2] = 0;

            ground[2, 0] = 1;
            ground[2, 1] = 0;
            ground[2, 2] = 0;


            isSolid = true;
        }
        protected virtual void initRenderingGL()
        {
            if (m_DeviceContext == 0 || m_RenderingContext == 0)
            {
                return;
            }
            if (m_DisplayPanel.Width == 0 || m_DisplayPanel.Height == 0)
            {
                return;
            }

            GL.glShadeModel(GL.GL_SMOOTH);
            GL.glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
            GL.glClearDepth(1.0f);


            GL.glClearColor(0.5f, 0.5f, 0.5f, 0.0f);
            GL.glEnable(GL.GL_DEPTH_TEST);
            GL.glDepthFunc(GL.GL_LEQUAL);
            GL.glHint(GL.GL_PERSPECTIVE_CORRECTION_Hint, GL.GL_NICEST);

            GL.glViewport(0, 0, m_DisplayPanel.Width, m_DisplayPanel.Height);
            GL.glMatrixMode(GL.GL_PROJECTION);
            GL.glLoadIdentity();

            //nice 3D
            GLU.gluPerspective(70.0, 1.0, 0.4, 500.0);

            GL.glMatrixMode(GL.GL_MODELVIEW);
            GL.glLoadIdentity();
            TextureUtills.GenerateTextures();
            //save the current MODELVIEW Matrix (now it is Identity)
            GL.glGetDoublev(GL.GL_MODELVIEW_MATRIX, AccumulatedRotationsTraslations);
        }
Exemple #11
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();
        }
Exemple #12
0
        protected virtual void initRenderingGL()
        {
            if (m_uint_DC == 0 || m_uint_RC == 0)
            {
                return;
            }
            if (this.Width == 0 || this.Height == 0)
            {
                return;
            }
            GL.glClearColor(0.5f, 0.5f, 0.5f, 0.0f);
            GL.glEnable(GL.GL_DEPTH_TEST);
            GL.glDepthFunc(GL.GL_LEQUAL);

            GL.glViewport(0, 0, this.Width, this.Height);
            GL.glMatrixMode(GL.GL_PROJECTION);
            GL.glLoadIdentity();

            //nice 3D
            GLU.gluPerspective(45.0, 1.0, 0.4, 100.0);


            GL.glMatrixMode(GL.GL_MODELVIEW);
            GL.glLoadIdentity();

            //save the current MODELVIEW Matrix (now it is Identity)
            GL.glGetDoublev(GL.GL_MODELVIEW_MATRIX, AccumulatedRotationsTraslations);
        }
Exemple #13
0
        protected void DrawThumbFinger(int fingerPart)
        {
            switch (fingerPart)
            {
            case 1:
                GL.glRotated(-45, 0, 0, 1);
                GL.glColor3d(1, 1, 1);
                GLU.gluSphere(objShpere, 0.6, 50, 50);
                GL.glTranslated(0, 0.2, 0);
                GL.glRotated(-90, 1, 0, 0);
                GL.glColor3d(1, 0.8, 0.6);
                GLU.gluCylinder(objFinger, 0.5, 0.5, 1, 50, 50);
                GL.glRotated(90, 1, 0, 0);
                GL.glTranslated(0, 0.8, 0);
                GL.glRotated(45, 0, 0, 1);
                break;

            case 2:
                GL.glRotated(-45, 0, 0, 1);
                GL.glColor3d(1, 1, 1);
                GLU.gluSphere(objShpere, 0.6, 50, 50);
                GL.glTranslated(0, 0.2, 0);
                GL.glRotated(-90, 1, 0, 0);
                GL.glColor3d(1, 0.8, 0.6);
                GLU.gluCylinder(objFinger, 0.5, 0.5, 0.7, 50, 50);
                GL.glRotated(90, 1, 0, 0);
                GL.glTranslated(0, 0.6, 0);
                GL.glColor3d(1, 1, 1);
                GLU.gluSphere(objShpere, 0.5, 50, 50);
                GL.glRotated(45, 0, 0, 1);
                GL.glTranslated(-4.6, -1.8, 0);
                break;
            }
        }
Exemple #14
0
 public Robot(uint texture)
 {
     this.headTexture = texture;
     gun1             = new Milkshape.Character("mauser_red9.ms3d");
     gun2             = new Milkshape.Character("hk-mp7.ms3d");
     sword            = new Milkshape.Character("katana.ms3d");
     obj = GLU.gluNewQuadric(); //!!!
 }
Exemple #15
0
 public cOGL(Control pb)
 {
     p      = pb;
     Width  = p.Width;
     Height = p.Height;
     InitializeGL();
     Bullet.bulletsize = 0.06f;
     obj = GLU.gluNewQuadric(); //!!!
 }
Exemple #16
0
 public cOGL(Control pb)
 {
     p      = pb;
     Width  = p.Width;
     Height = p.Height;
     InitializeGL();
     obj = GLU.gluNewQuadric(); //!!!
     PrepareLists();
 }
Exemple #17
0
 public void createStemList()
 {
     GL.glNewList(STEM_LIST + currentTree, GL.GL_COMPILE);
     GL.glPushMatrix();
     GL.glRotatef(-90, 1, 0, 0);
     GLU.gluCylinder(obj, 0.1 * widhtScale, 0.08 * widhtScale, 1, 10, 10);
     GL.glPopMatrix();
     GL.glEndList();
 }
Exemple #18
0
        public void update_cube_map_prespective()
        {
            GL.glMatrixMode(GL.GL_PROJECTION);
            GL.glLoadIdentity();

            GLU.gluPerspective(viewAngle, (float)Width / (float)Height, 0.45f, 30.0f);

            GL.glMatrixMode(GL.GL_MODELVIEW);
            GL.glLoadIdentity();
        }
Exemple #19
0
 public static void glutSolidSphere(double radius, int slices, int stacks)
 {
     QUAD_OBJ_INIT();
     GLU.gluQuadricDrawStyle(quadObj, GLU.GLU_FILL);
     GLU.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
     // If we ever changed/used the texture or orientation state
     // of quadObj, we'd need to change it to the defaults here
     // with gluQuadricTexture and/or gluQuadricOrientation.
     GLU.gluSphere(quadObj, radius, slices, stacks);
 }
Exemple #20
0
 public static void glutSolidCone(double conebase, double height, int slices, int stacks)
 {
     QUAD_OBJ_INIT();
     GLU.gluQuadricDrawStyle(quadObj, GLU.GLU_FILL);
     GLU.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
     // If we ever changed/used the texture or orientation state
     // of quadObj, we'd need to change it to the defaults here
     // with gluQuadricTexture and/or gluQuadricOrientation.
     GLU.gluCylinder(quadObj, conebase, 0.0, height, slices, stacks);
 }
Exemple #21
0
        private void drawHandle(float i_Height)
        {
            GLUquadric obj = GLU.gluNewQuadric();

            GL.glTranslatef(0.5f, 0.0f + i_Height, 0.5f);
            GL.glRotatef(-90, 1, 0, 0);
            GLU.gluCylinder(obj, 0.1, 0.1, 0.5, 16, 16);
            GL.glTranslatef(-0.5f, -1 * i_Height, -0.5f);

            GLU.gluDeleteQuadric(obj);
        }
Exemple #22
0
 public cOGL(Control pb)
 {
     network.Hide();
     p      = pb;
     Width  = p.Width;
     Height = p.Height;
     InitializeGL();
     Bullet.bulletsize = 0.06f;
     tank.RandomPosition(worldsize);
     obj        = GLU.gluNewQuadric(); //!!!
     fullscreen = true;
 }
Exemple #23
0
        private void DrawPillar(double baseRadius, double topRadius, double height)
        {
            GL.glEnable(GL.GL_TEXTURE_2D);
            GL.glColor3f(1.0f, 1.0f, 1.0f);
            GL.glBindTexture(GL.GL_TEXTURE_2D, Textures[2]);

            GLUquadric obj = GLU.gluNewQuadric();

            GLU.gluQuadricTexture(obj, 2);
            GLU.gluCylinder(obj, baseRadius, topRadius, height, 32, 32);
            GLU.gluDeleteQuadric(obj);

            GL.glDisable(GL.GL_TEXTURE_2D);
        }
Exemple #24
0
        protected virtual void initRenderingGL()
        {
            if (m_uint_DC == 0 || m_uint_RC == 0)
            {
                return;
            }
            if (this.Width == 0 || this.Height == 0)
            {
                return;
            }
            GL.glShadeModel(GL.GL_SMOOTH);
            GL.glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
            GL.glClearDepth(1.0f);


            GL.glEnable(GL.GL_LIGHT0);
            GL.glEnable(GL.GL_COLOR_MATERIAL);
            GL.glColorMaterial(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT_AND_DIFFUSE);

            GL.glEnable(GL.GL_DEPTH_TEST);
            GL.glDepthFunc(GL.GL_LEQUAL);
            GL.glHint(GL.GL_PERSPECTIVE_CORRECTION_Hint, GL.GL_NICEST);

            GL.glViewport(0, 0, this.Width, this.Height);
            GL.glMatrixMode(GL.GL_PROJECTION);
            GL.glLoadIdentity();

            //nice 3D
            GLU.gluPerspective(45.0, 1.0, 0.4, 100.0);

            //! TEXTURE 1a
            GL.glEnable(GL.GL_COLOR_MATERIAL);
            float[] emis = { 0.3f, 0.3f, 0.3f, 1 };
            GL.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_EMISSION, emis);
            //! TEXTURE 1a



            GL.glShadeModel(GL.GL_SMOOTH);
            GLU.gluPerspective(viewAngle, (float)Width / (float)Height, 0.45f, 30.0f);

            GL.glMatrixMode(GL.GL_MODELVIEW);
            GL.glLoadIdentity();

            //! TEXTURE 1a
            GenerateTextures();
            //! TEXTURE 1b
            //save the current MODELVIEW Matrix (now it is Identity)
            GL.glGetDoublev(GL.GL_MODELVIEW_MATRIX, AccumulatedRotationsTraslations);
        }
        public cOGL(Control pb)
        {
            p      = pb;
            Width  = p.Width;
            Height = p.Height;
            obj    = GLU.gluNewQuadric();

            InitializeGL();

            //3 points of ground plane
            ground[0, 0] = 1;
            ground[0, 1] = 0;
            ground[0, 2] = 0;

            ground[1, 0] = -1;
            ground[1, 1] = 0;
            ground[1, 2] = 0;

            ground[2, 0] = 0;
            ground[2, 1] = 0;
            ground[2, 2] = -1;

            //light position

            pos[0] = light_position[0] = ScrollValue[9];
            pos[1] = light_position[1] = ScrollValue[10];
            pos[2] = light_position[2] = ScrollValue[11];
            pos[3] = light_position[3] = 0;


            light_position_reflected[0] = -ScrollValue[9];
            light_position_reflected[1] = -ScrollValue[10];
            light_position_reflected[2] = -ScrollValue[11];
            light_position_reflected[3] = 0;


            GL.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, light_ambient);
            GL.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, light_diffuse);
            GL.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, light_specular);
            GL.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, light_position);

            GL.glLightfv(GL.GL_LIGHT1, GL.GL_AMBIENT, light_ambient);
            GL.glLightfv(GL.GL_LIGHT1, GL.GL_DIFFUSE, light_diffuse);
            GL.glLightfv(GL.GL_LIGHT1, GL.GL_SPECULAR, light_specular);
            GL.glLightfv(GL.GL_LIGHT1, GL.GL_POSITION, light_position_reflected);
            GL.glLightModelfv(GL.GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
        }
Exemple #26
0
        private void DrawLightBeam()
        {
            float length = GlobalProperties.LightBeamLength;
            Color c      = GlobalProperties.LightBeamColor;

            GL.glColor4ub(c.R, c.G, c.B, (byte)GlobalProperties.LightBeamIntesity);

            //GL.glEnable(GL.GL_DEPTH_TEST);
            //GL.glHint(GL.GL_PERSPECTIVE_CORRECTION_Hint, GL.GL_NICEST);
            //GL.glShadeModel(GL.GL_SMOOTH);
            //GL.glEnable(GL.GL_LIGHT0);

            GLUquadric obj = GLU.gluNewQuadric();

            GLU.gluCylinder(obj, 0.05, length * 0.05, length, 32, 32);
            GLU.gluDeleteQuadric(obj);
        }
        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();
            }
        }
Exemple #28
0
        void DrawBounds()
        {
            if (isBounds)
            {
                GL.glScalef(0.99f, 0.99f, 0.99f);
                GL.glLineWidth(2);
                GL.glColor3f(1.0f, 0.0f, 0.0f);
                GL.glDisable(GL.GL_LIGHTING);
                GL.glBegin(GL.GL_LINE_LOOP);
                GL.glVertex3f(-1, -1, -1);
                GL.glVertex3f(1, -1, -1);
                GL.glVertex3f(1, -1, 1);
                GL.glVertex3f(-1, -1, 1);
                GL.glEnd();
                GL.glBegin(GL.GL_LINE_LOOP);
                GL.glVertex3f(-1, 1, -1);
                GL.glVertex3f(1, 1, -1);
                GL.glVertex3f(1, 1, 1);
                GL.glVertex3f(-1, 1, 1);
                GL.glEnd();
                GL.glBegin(GL.GL_LINES);
                GL.glVertex3f(-1, -1, -1);
                GL.glVertex3f(-1, 1, -1);

                GL.glVertex3f(1, -1, -1);
                GL.glVertex3f(1, 1, -1);

                GL.glVertex3f(1, -1, 1);
                GL.glVertex3f(1, 1, 1);

                GL.glVertex3f(-1, -1, 1);
                GL.glVertex3f(-1, 1, 1);
                GL.glEnd();
                GL.glScalef(1.0f / 0.99f, 1.0f / 0.99f, 1.0f / 0.99f);
            }

            GL.glEnable(GL.GL_COLOR_MATERIAL);
            GL.glEnable(GL.GL_LIGHTING);
            GL.glEnable(GL.GL_LIGHT0);
            GL.glTranslatef(0.1f, 0.2f, -0.7f);
            GL.glColor3f(0, 1, 0);
            GLU.gluSphere(obj, 0.05, 16, 16);
            GL.glTranslatef(-0.1f, -0.2f, 0.7f);
            GL.glDisable(GL.GL_LIGHTING);
        }
Exemple #29
0
        private void DrawBackground()
        {
            GL.glDisable(GL.GL_LIGHTING);
            GL.glEnable(GL.GL_TEXTURE_2D);
            GL.glColor4f(1.0f, 1.0f, 1.0f, 0.5f);

            GL.glBindTexture(GL.GL_TEXTURE_2D, Textures[4]);

            float cor = GlobalProperties.seaSize / 2;

            GLUquadric obj = GLU.gluNewQuadric();

            GLU.gluQuadricTexture(obj, 4);
            GLU.gluCylinder(obj, cor, cor, cor, 32, 32);
            GLU.gluDeleteQuadric(obj);

            GL.glDisable(GL.GL_TEXTURE_2D);
            GL.glEnable(GL.GL_LIGHTING);
        }
Exemple #30
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);
 }