Android Open Source - OpenGlDraw_Android Shape Cup10 Verts






From Project

Back to project page OpenGlDraw_Android.

License

The source code is released under:

GNU General Public License

If you think the Android project OpenGlDraw_Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.example.opengldraw.shapes;
//  ww  w .j  ava  2  s.  c  o  m
import com.example.opengldraw.utils.ShapeDataInterface;

public class ShapeCup10Verts extends Object implements ShapeDataInterface {

  float vertices[] = {
      0.000000f, -0.500000f, -1.000000f,
       -0.587785f, -0.500000f, -0.809017f,
       -0.951057f, -0.500000f, -0.309017f,
       -0.951056f, -0.500000f, 0.309017f,
       -0.587785f, -0.500000f, 0.809017f,
       0.000000f, -0.500000f, 1.000000f,
       0.587785f, -0.500000f, 0.809017f,
       0.951056f, -0.500000f, 0.309017f,
       0.951056f, -0.500000f, -0.309017f,
       0.587785f, -0.500000f, -0.809017f,
       0.000000f, 1.266860f, -1.617215f,
       -0.950575f, 1.266860f, -1.308354f,
       -1.538063f, 1.266860f, -0.499747f,
       -1.538063f, 1.266860f, 0.499747f,
       -0.950575f, 1.266860f, 1.308355f,
       0.000000f, 1.266860f, 1.617215f,
       0.950575f, 1.266860f, 1.308354f,
       1.538063f, 1.266860f, 0.499747f,
       1.538063f, 1.266860f, -0.499747f,
       0.950575f, 1.266860f, -1.308355f
  };
  
  float colors[] = {
    50/255f, 205/255f, 50/255f, 1.0f,  50/255f, 205/255f, 50/255f, 1.0f,  50/255f, 205/255f, 50/255f, 1.0f,
    50/255f, 205/255f, 50/255f, 1.0f,  50/255f, 205/255f, 50/255f, 1.0f,  50/255f, 205/255f, 50/255f, 1.0f,
    50/255f, 205/255f, 50/255f, 1.0f,  50/255f, 205/255f, 50/255f, 1.0f
  };
  
  short indices[] = {
      0, 1, 11,  0, 11, 10,
      1, 2, 12,  1, 12, 11,
      2, 3, 13,  2, 13, 12,
      3, 4, 14,  3, 14, 13,
      4, 5, 15,  4, 15, 14,
      5, 6, 16,  5, 16, 15,
      6, 7, 17,  6, 17, 16,
      7, 8, 18,  7, 18, 17,
      8, 9, 19,  8, 19, 18,
      9, 0, 10,  9, 10, 19
  };
  
  float normals[] = {
      -0.293256f, -0.315287f, 0.902549f,
       0.293256f, -0.315287f, 0.902549f,
       0.767754f, -0.315287f, 0.557806f,
       -0.293256f, -0.315287f, -0.902549f,
       0.948997f, -0.315287f, 0.000000f,
       -0.767754f, -0.315287f, -0.557806f,
       0.767754f, -0.315287f, -0.557806f,
       -0.948996f, -0.315286f, 0.000000f,
       0.293256f, -0.315287f, -0.902549f,
       -0.767754f, -0.315286f, 0.557806f,
       0.948997f, -0.315286f, 0.000000f,
       -0.767754f, -0.315286f, -0.557806f,
       0.767754f, -0.315286f, -0.557806f,
       -0.948997f, -0.315286f, 0.000000f,
       -0.767754f, -0.315287f, 0.557806f
  };
  
  @Override
  public float[] getVertices() {
    return vertices;
  }

  @Override
  public float[] getColors() {
    return colors;
  }

  @Override
  public float[] getNormals() {
    return normals;
  }

  @Override
  public short[] getDrawOrder() {
    return indices;
  }
  
  @Override
  public float[] getTextCoords() {
    return new float[10];
  }
  
}




Java Source Code List

com.example.opengldraw.MainActivity.java
com.example.opengldraw.gl.GLSurfaceViewDraw.java
com.example.opengldraw.gl.RendererDraw.java
com.example.opengldraw.gl.ShapeDrawer.java
com.example.opengldraw.shapes.FireEngine.java
com.example.opengldraw.shapes.ShapeCube.java
com.example.opengldraw.shapes.ShapeCup10Verts.java
com.example.opengldraw.shapes.ShapeCup64Verts.java
com.example.opengldraw.shapes.ShapeSquare.java
com.example.opengldraw.utils.IndexOrderObj.java
com.example.opengldraw.utils.ShapeDataInterface.java
com.example.opengldraw.utils.WavefrontObj.java