This commit is contained in:
Antoine
2021-06-17 01:46:36 +02:00
parent fc7b2b7945
commit d587940b45
2 changed files with 12 additions and 0 deletions

View File

@ -216,6 +216,16 @@ public class ObjectGl {
this.vertexArray = new VertexArray(Primitive.createRectangle(this.zPos, this.width, this.height), Primitive.rectangle_indices, colorBuffer, Primitive.stdTexWrap);
}
public void setColorVerticalGradient(Vector3f color1, Vector3f color2){
float[] colorBuffer = new float[] {
color1.x, color1.y, color1.z,
color1.x, color1.y, color1.z,
color2.x, color2.y, color2.z,
color2.x, color2.y, color2.z
};
this.vertexArray = new VertexArray(Primitive.createRectangle(this.zPos, this.width, this.height), Primitive.rectangle_indices, colorBuffer, Primitive.stdTexWrap);
}
public void setTextureWrap(float[] texture){
this.textureWrap = texture;
this.vertexArray.swapTextureBufferObject(texture);