Back to project page OpenGlDraw_Android.
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.
package com.example.opengldraw.shapes; /*from w w w . j a v a 2 s . c om*/ import com.example.opengldraw.utils.ShapeDataInterface; public class ShapeSquare extends Object implements ShapeDataInterface { float vertices[] = { -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f }; /* set the materials to the same color values (or at least one of the materials) */ float colors[] = { 50/255f, 205/255f, 50/255f, 1.0f }; short indices[] = { 0, 1, 2, 2, 0, 3 }; float normals[] = { -0f, 0f, 1f, 0f, 0f, -1f, 1f, -0f, 0f, -1f, -0f, -0f, -0f, -0f, 1f, -0f, -1f, 0f, 1f, 0f, 0f, 0f, 1f, -0f }; float textCoords[] = { 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f }; @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 textCoords; } }