crank rotation test

This commit is contained in:
KitsuShadow
2015-08-17 01:34:21 -04:00
parent 4f28b5164d
commit e7d0d526c0

View File

@@ -6,6 +6,7 @@ import org.lwjgl.opengl.GL13;
import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
@@ -17,6 +18,8 @@ import nmd.primal.energy.tileents.TileEntCrank;
public class RenderCrank extends TileEntitySpecialRenderer { public class RenderCrank extends TileEntitySpecialRenderer {
public int i = 0;
public int a = 0;
public static final ResourceLocation MODEL = new ResourceLocation("energy:models/Crank.obj"); public static final ResourceLocation MODEL = new ResourceLocation("energy:models/Crank.obj");
public static final ResourceLocation TEXTURE = new ResourceLocation("energy:models/Crank.png"); public static final ResourceLocation TEXTURE = new ResourceLocation("energy:models/Crank.png");
private IModelCustom model = AdvancedModelLoader.loadModel(MODEL); private IModelCustom model = AdvancedModelLoader.loadModel(MODEL);
@@ -33,11 +36,8 @@ public class RenderCrank extends TileEntitySpecialRenderer {
GL11.glRotatef(180, 0.0f, 0.0f, 1.0f); GL11.glRotatef(180, 0.0f, 0.0f, 1.0f);
GL11.glTranslatef(-1.0f, -1.0f, -0.0f); GL11.glTranslatef(-1.0f, -1.0f, -0.0f);
} }
if(tile.getBlockMetadata()==1){
//GL11.glRotatef(180, 0.0f, 0.0f, 1.0f);
//GL11.glTranslatef(-1.0f, -1.0f, -0.0f);
//GL11.glRotated(45, 0, 1.0f, 0);
}
if(tile.getBlockMetadata()==2){ if(tile.getBlockMetadata()==2){
GL11.glRotatef(-90, 1.0f, 0.0f, 0.0f); GL11.glRotatef(-90, 1.0f, 0.0f, 0.0f);
GL11.glTranslatef(0.0f, -1.0f, 0.0f); GL11.glTranslatef(0.0f, -1.0f, 0.0f);
@@ -67,6 +67,27 @@ public class RenderCrank extends TileEntitySpecialRenderer {
GL11.glTranslatef(1.0F, 0.48F, 1.0F); GL11.glTranslatef(1.0F, 0.48F, 1.0F);
if(tl.getBlockMetadata()==1){
//System.out.println((float)6.2832*(180F / (float)Math.PI));
//for(int a=0; a<3600; a = a+10){
GL11.glRotatef(i, 0.0F, 1.0F, 0.0F);
//}
//GL11.glRotatef((((180F / (float)Math.PI))), 0.0F, 1.0F, 0.0F);
//(float)Minecraft.getSystemTime()
}
a++;
if(a==5){
i=i+2;
a=0;
}
if(i==360){
i=0;
}
//
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE);