Android Open Source - OpenGL-es3-android Shapes






From Project

Back to project page OpenGL-es3-android.

License

The source code is released under:

GNU General Public License

If you think the Android project OpenGL-es3-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.opengles3.demo.geometry;
//from w w w  . j  av a  2  s. c o  m
public class Shapes {
  public static class Point{
    public final float x, y, z;
    public Point(float x, float y, float z){
      this.x = x;
      this.y = y;
      this.z = z;
    }
    public Point translate(float x, float y, float z){
      return new Point(this.x+x, this.y+y, this.z+z);
    }
  }
  public static class Circle{
    public final Point center;
    public final float radius;
    public Circle(Point center, float radius) {
      this.center = center;
      this.radius = radius;
    }
    public Circle scale(float scale){
      return new Circle(center, radius*scale);
    }
    
  }
  public static class Cylinder{
    public final Point center;
    public final float radius;
    public final float height;
    public Cylinder(Point center, float radius, float height){
      this.center = center;
      this.radius = radius;
      this.height = height;
    }
    public Cylinder scale(float hScale, float rScale){
      return new Cylinder(center, hScale*height, rScale*radius);
    }
  }
}




Java Source Code List

com.opengles3.demo.GLRenderer.java
com.opengles3.demo.GLTextureView.java
com.opengles3.demo.MainActivity.java
com.opengles3.demo.geometry.ObjectBuilder.java
com.opengles3.demo.geometry.Shapes.java
com.opengles3.demo.geometry.VertexArray.java
com.opengles3.demo.objects.Mallet.java
com.opengles3.demo.objects.Puck.java
com.opengles3.demo.objects.Table.java
com.opengles3.demo.objects.TexturedTriangleFan.java
com.opengles3.demo.programs.ColorShaderProgram.java
com.opengles3.demo.programs.ShaderProgram.java
com.opengles3.demo.programs.TextureShaderProgram.java
com.opengles3.demo.tools.Debug.java
com.opengles3.demo.tools.Tools.java