glLineWidth() private méthode

private glLineWidth ( float width ) : void
width float
Résultat void
Exemple #1
0
        void DrawFigures()
        {
            GL.glEnable(GL.GL_COLOR_MATERIAL);
            GL.glEnable(GL.GL_LIGHT0);
            GL.glEnable(GL.GL_LIGHTING);

            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            GL.glRotatef(ROBOT_angle, 0, 0, 1);
            GL.glCallList(ROBOT_LIST);
            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

            // saw
            GL.glLineStipple(1, 0x1243);
            GL.glLineWidth(3);
            GL.glEnable(GL.GL_LINE_STIPPLE);

            GL.glColor3f(1, 1, 0);  //yellow
            GL.glBegin(GL.GL_LINES);
            float angle;

            for (int i = 0; i <= 9; i++)
            {
                angle = alpha + i * 6.283f / 10;
                GL.glVertex3d(0.5f * r * Math.Cos(angle), 0.5f * r * Math.Sin(angle), 0.01f);
                GL.glVertex3d(1.5f * r * Math.Cos(angle + 0.6), 1.5f * r * Math.Sin(angle + 0.6), 0.01f);
            }
            GL.glEnd();
            GL.glLineWidth(1);
            GL.glDisable(GL.GL_LINE_STIPPLE);
        }
Exemple #2
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);
        }