Files
EnderIO/common/crazypants/enderio/machine/hypercube/HyperCubeModel.java
T
cp 4ea4f052de Added models for tesseract. Texture still not done for one of them.
Switch between implementations via the config using
    B:useAlternateTesseractModel=true
2013-09-17 16:10:45 +08:00

40 lines
1.1 KiB
Java

package crazypants.enderio.machine.hypercube;
import org.lwjgl.opengl.GL11;
import crazypants.render.RenderUtil;
import net.minecraft.client.model.ModelBase;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
public class HyperCubeModel extends ModelBase implements IModel {
public static final float SCALE = 1/16f;
private static final String TEXTURE = "enderio:models/hyperCube.png";
//private static final String MODEL = "enderio:models/hyperCube.obj";
private static final String MODEL = "/assets/enderio/models/hyperCube.obj";
private IModelCustom model;
public HyperCubeModel() {
model = AdvancedModelLoader.loadModel(MODEL);
}
public void render() {
GL11.glPushMatrix();
GL11.glScalef(SCALE, SCALE, SCALE);
RenderUtil.bindTexture(TEXTURE);
model.renderAll();
GL11.glPopMatrix();
}
public void render(TileHyperCube cube, double x, double y, double z) {
GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5f, (float) y + 0.5f, (float) z + 0.5f);
render();
GL11.glPopMatrix();
}
}