Example usage for com.badlogic.gdx.graphics.glutils ImmediateModeRenderer20 color

List of usage examples for com.badlogic.gdx.graphics.glutils ImmediateModeRenderer20 color

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.glutils ImmediateModeRenderer20 color.

Prototype

public void color(Color color) 

Source Link

Usage

From source file:ta.shape3D.Triangle3D.java

License:Apache License

/**
 * draw the triangle in the OpenGL environment. The Color of triangle depends of the tree colors defined. 
 * If the colors is different, the color of the triangle will be a blend of these colors. 
 * If the TEXTURE_2D is enable, the texture which is defined will be displayed according to
 *  the textures points defined.//  www.  j  av a2  s  .  com
 * @param rendu the renderer which is used for drawing triangle, you need to call the begin() method of this renderer
 * before using this method.
 */
public void render(ImmediateModeRenderer20 rendu) {
    //if(image!=null) image.bind(GL20.GL_TEXTURE_2D);
    rendu.texCoord(pointsTexture[0].x, pointsTexture[0].y);
    rendu.color(couleurs[0]);
    rendu.vertex(points[0].x, points[0].y, points[0].z);
    rendu.texCoord(pointsTexture[1].x, pointsTexture[1].y);
    rendu.color(couleurs[1]);
    rendu.vertex(points[1].x, points[1].y, points[1].z);
    rendu.texCoord(pointsTexture[2].x, pointsTexture[2].y);
    rendu.color(couleurs[2]);
    rendu.vertex(points[2].x, points[2].y, points[2].z);
}