Skip to content

Instantly share code, notes, and snippets.

View Eladkay's full-sized avatar

Eladkay Eladkay

View GitHub Profile
public static void addCubeToBuffer(BufferBuilder buff,
double x1, double y1, double z1, double x2, double y2, double z2,
Vec4d[] uv, float r, float g, float b, float a,
boolean north, boolean south, boolean up, boolean down, boolean east, boolean west
){
if (north){
buff.pos(x1, y1, z1).tex(uv[0].x, uv[0].y).color(r,g,b,a).normal(0,0,-1.0f).endVertex();
buff.pos(x2, y1, z1).tex(uv[0].x+uv[0].z, uv[0].y).color(r,g,b,a).normal(0,0,-1.0f).endVertex();
buff.pos(x2, y2, z1).tex(uv[0].x+uv[0].z, uv[0].y+uv[0].w).color(r,g,b,a).normal(0,0,-1.0f).endVertex();
buff.pos(x1, y2, z1).tex(uv[0].x, uv[0].y+uv[0].w).color(r,g,b,a).normal(0,0,-1.0f).endVertex();