public void getbox() { // GL.glColor3f(0, 1, 0); GLU.gluQuadricNormals(q, GLU.GLU_SMOOTH); GLU.gluQuadricTexture(q, 1); GLU.gluSphere(q, 0.25, 32, 32); }
public void getbox(float x, float y, float z, float r) { GL.glTranslatef(x, y, z); GLU.gluQuadricNormals(q, GLU.GLU_SMOOTH); GLU.gluQuadricTexture(q, 1); GLU.gluSphere(q, r, 32, 32); }
public void butterflydraw() { GLU.gluQuadricNormals(q1, GLU.GLU_SMOOTH); GLU.gluQuadricTexture(q1, 1); GL.glTranslatef(0.1f, 0.0f, 0); GL.glRotatef(90, 1.0f, 0.0f, 0.0f); GL.glColor3f(0.5f, 0.24f, 0.43f); GLU.gluCylinder(q1, 0.1, 0.1, 0.5f, 13, 13); GL.glTranslatef(0.11f, 0.19f, 0); GLU.gluSphere(q1, 0.15, 32, 32); GL.glTranslatef(1.19f, 0, 0); GL.glBegin(GL.GL_TRIANGLES); // start drawing a triangle GL.glColor3f(1.0f, 0.0f, 0.0f); // red GL.glVertex3f(0.2f, 0.5f, 0.0f); // top point of the triangle GL.glColor3f(0.0f, 1.0f, 0.0f); // green GL.glVertex3f(-0.1f, -0.25f, 0.0f); // left point of the triangle GL.glColor3f(0.0f, 0.0f, 1.0f); // blue GL.glVertex3f(0.5f, -0.7f, 0.0f); // right point of the triangle GL.glEnd(); GL.glTranslatef(1.19f, 0, 0); GL.glBegin(GL.GL_TRIANGLES); // start drawing a triangle GL.glColor3f(1.0f, 0.0f, 0.0f); // red GL.glVertex3f(-0.3f, 0.5f, 0.0f); // top point of the triangle GL.glColor3f(0.0f, 1.0f, 0.0f); // green GL.glVertex3f(0.0f, -0.25f, 0.0f); // left point of the triangle GL.glColor3f(0.0f, 0.0f, 1.0f); // blue GL.glVertex3f(-0.5f, -0.7f, 0.0f); // right point of the triangle GL.glEnd(); }
public void getbox() { GL.glRotatef(80, 1, 0, 0); // GL.glColor3f(0, 1, 0); GLU.gluQuadricNormals(q, GLU.GLU_SMOOTH); GLU.gluQuadricTexture(q, 1); GLU.gluDisk(q, 0.01, 0.2, 32, 32); GL.glRotatef(80, -1, 0, 0); }
public void getbox() { GLUquadric q = GLU.gluNewQuadric(); color c1 = new color(); GL.glScalef(0.125f, 0.125f, 0.125f); GL.glBegin(GL.GL_QUADS); // Front Face // Front Face GL.glNormal3f(0.0f, 0.0f, 1.0f); GL.glTexCoord2f(0.0f, 0.0f); GL.glVertex3f(-1.0f, -1.0f, 1.0f); GL.glTexCoord2f(1.0f, 0.0f); GL.glVertex3f(1.0f, -1.0f, 1.0f); GL.glTexCoord2f(1.0f, 1.0f); GL.glVertex3f(1.0f, 1.0f, 1.0f); GL.glTexCoord2f(0.0f, 1.0f); GL.glVertex3f(-1.0f, 1.0f, 1.0f); // Back Face GL.glNormal3f(0.0f, 0.0f, -1.0f); GL.glTexCoord2f(1.0f, 0.0f); GL.glVertex3f(-1.0f, -1.0f, -1.0f); GL.glTexCoord2f(1.0f, 1.0f); GL.glVertex3f(-1.0f, 1.0f, -1.0f); GL.glTexCoord2f(0.0f, 1.0f); GL.glVertex3f(1.0f, 1.0f, -1.0f); GL.glTexCoord2f(0.0f, 0.0f); GL.glVertex3f(1.0f, -1.0f, -1.0f); // Top Face GL.glNormal3f(0.0f, 1.0f, 0.0f); GL.glTexCoord2f(0.0f, 1.0f); GL.glVertex3f(-1.0f, 1.0f, -1.0f); GL.glTexCoord2f(0.0f, 0.0f); GL.glVertex3f(-1.0f, 1.0f, 1.0f); GL.glTexCoord2f(1.0f, 0.0f); GL.glVertex3f(1.0f, 1.0f, 1.0f); GL.glTexCoord2f(1.0f, 1.0f); GL.glVertex3f(1.0f, 1.0f, -1.0f); // Bottom Face GL.glNormal3f(0.0f, -1.0f, 0.0f); GL.glTexCoord2f(1.0f, 1.0f); GL.glVertex3f(-1.0f, -1.0f, -1.0f); GL.glTexCoord2f(0.0f, 1.0f); GL.glVertex3f(1.0f, -1.0f, -1.0f); GL.glTexCoord2f(0.0f, 0.0f); GL.glVertex3f(1.0f, -1.0f, 1.0f); GL.glTexCoord2f(1.0f, 0.0f); GL.glVertex3f(-1.0f, -1.0f, 1.0f); // Right face GL.glNormal3f(1.0f, 0.0f, 0.0f); GL.glTexCoord2f(1.0f, 0.0f); GL.glVertex3f(1.0f, -1.0f, -1.0f); GL.glTexCoord2f(1.0f, 1.0f); GL.glVertex3f(1.0f, 1.0f, -1.0f); GL.glTexCoord2f(0.0f, 1.0f); GL.glVertex3f(1.0f, 1.0f, 1.0f); GL.glTexCoord2f(0.0f, 0.0f); GL.glVertex3f(1.0f, -1.0f, 1.0f); // Left Face GL.glNormal3f(-1.0f, 0.0f, 0.0f); GL.glTexCoord2f(0.0f, 0.0f); GL.glVertex3f(-1.0f, -1.0f, -1.0f); GL.glTexCoord2f(1.0f, 0.0f); GL.glVertex3f(-1.0f, -1.0f, 1.0f); GL.glTexCoord2f(1.0f, 1.0f); GL.glVertex3f(-1.0f, 1.0f, 1.0f); GL.glTexCoord2f(0.0f, 1.0f); GL.glVertex3f(-1.0f, 1.0f, -1.0f); GL.glEnd(); GL.glScalef(8, 8, 8); GL.glTranslatef(0, -0.1f, 0.3f); GL.glColor3fv(c1.yellow); lo.LoadTextures1(5); GLU.gluQuadricNormals(q, GLU.GLU_SMOOTH); GLU.gluQuadricTexture(q, 1); GLU.gluDisk(q, 0.01, 0.1, 32, 32); GL.glTranslatef(0, -0.01f, -0.3f); GLU.gluDisk(q, 0.01, 0.1, 32, 32); }