List of usage examples for com.badlogic.gdx.graphics GL20 GL_TRIANGLES
int GL_TRIANGLES
To view the source code for com.badlogic.gdx.graphics GL20 GL_TRIANGLES.
Click Source Link
From source file:com.watabou.noosa.NoosaScript.java
License:Open Source License
public void drawQuad(FloatBuffer vertices) { vertices.position(0);// ww w. j a v a 2 s .co m aXY.vertexPointer(2, 4, vertices); vertices.position(2); aUV.vertexPointer(2, 4, vertices); Gdx.gl.glDrawElements(GL20.GL_TRIANGLES, Quad.SIZE, GL20.GL_UNSIGNED_SHORT, Quad.INDICES_1); }
From source file:com.watabou.noosa.NoosaScript.java
License:Open Source License
public void drawQuadSet(FloatBuffer vertices, int size) { if (size == 0) { return;// w w w . j a v a 2s . c o m } vertices.position(0); aXY.vertexPointer(2, 4, vertices); vertices.position(2); aUV.vertexPointer(2, 4, vertices); Gdx.gl.glDrawElements(GL20.GL_TRIANGLES, Quad.SIZE * size, GL20.GL_UNSIGNED_SHORT, Quad.getIndices(size)); }
From source file:gaia.cu9.ari.gaiaorbit.util.g3d.MeshBuilder2.java
License:Apache License
@Override public void triangle(short index1, short index2, short index3) { if (primitiveType == GL20.GL_TRIANGLES || primitiveType == GL20.GL_POINTS) { index(index1, index2, index3);/*from ww w. j av a 2 s. co m*/ } else if (primitiveType == GL20.GL_LINES) { index(index1, index2, index2, index3, index3, index1); } else throw new GdxRuntimeException("Incorrect primitive type"); }
From source file:gaia.cu9.ari.gaiaorbit.util.g3d.MeshBuilder2.java
License:Apache License
@Override public void rect(short corner00, short corner10, short corner11, short corner01) { if (primitiveType == GL20.GL_TRIANGLES) { index(corner00, corner10, corner11, corner11, corner01, corner00); } else if (primitiveType == GL20.GL_LINES) { index(corner00, corner10, corner10, corner11, corner11, corner01, corner01, corner00); } else if (primitiveType == GL20.GL_POINTS) { index(corner00, corner10, corner11, corner01); } else//from w w w.j av a 2 s. co m throw new GdxRuntimeException("Incorrect primitive type"); }
From source file:gaia.cu9.ari.gaiaorbit.util.g3d.ModelBuilder2.java
License:Apache License
/** Convenience method to create a model with a single node containing a box shape. The resources the Material might contain are * not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createBox(float width, float height, float depth, final Material material, final long attributes) { return createBox(width, height, depth, GL20.GL_TRIANGLES, material, attributes); }
From source file:gaia.cu9.ari.gaiaorbit.util.g3d.ModelBuilder2.java
License:Apache License
/** Convenience method to create a model with a single node containing a rectangle shape. The resources the Material might * contain are not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createRect(float x00, float y00, float z00, float x10, float y10, float z10, float x11, float y11, float z11, float x01, float y01, float z01, float normalX, float normalY, float normalZ, final Material material, final long attributes) { return createRect(x00, y00, z00, x10, y10, z10, x11, y11, z11, x01, y01, z01, normalX, normalY, normalZ, GL20.GL_TRIANGLES, material, attributes); }
From source file:gaia.cu9.ari.gaiaorbit.util.g3d.ModelBuilder2.java
License:Apache License
/** Convenience method to create a model with a single node containing a cylinder shape. The resources the Material might * contain are not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createCylinder(float width, float height, float depth, int divisions, final Material material, final long attributes) { return createCylinder(width, height, depth, divisions, GL20.GL_TRIANGLES, material, attributes); }
From source file:gaia.cu9.ari.gaiaorbit.util.g3d.ModelBuilder2.java
License:Apache License
/** Convenience method to create a model with a single node containing a cylinder shape. The resources the Material might * contain are not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createCylinder(float width, float height, float depth, int divisions, final Material material, final long attributes, float angleFrom, float angleTo) { return createCylinder(width, height, depth, divisions, GL20.GL_TRIANGLES, material, attributes, angleFrom, angleTo);/*from ww w.j a v a 2 s.c o m*/ }
From source file:gaia.cu9.ari.gaiaorbit.util.g3d.ModelBuilder2.java
License:Apache License
/** Convenience method to create a model with a single node containing a cone shape. The resources the Material might contain * are not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createCone(float width, float height, float depth, int divisions, final Material material, final long attributes) { return createCone(width, height, depth, divisions, GL20.GL_TRIANGLES, material, attributes); }
From source file:gaia.cu9.ari.gaiaorbit.util.g3d.ModelBuilder2.java
License:Apache License
/** Convenience method to create a model with a single node containing a cone shape. The resources the Material might contain * are not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createCone(float width, float height, float depth, int divisions, final Material material, final long attributes, float angleFrom, float angleTo) { return createCone(width, height, depth, divisions, GL20.GL_TRIANGLES, material, attributes, angleFrom, angleTo);/*from ww w . ja v a 2 s. c o m*/ }