ага. вот оно как. но я не понял часть с блендером. мне их независимыми моделями делать или как?BlesseNtumble написал(а):В Синьке или Блендере разделяешь шейпы на группы объектов.
В рендере рендеришь часть по ее имени: model.renderPart("NAME");
А дальше только двигать часть с помощью GL11.glTranslatef(X, Y, Z); при определенных проверках.
random написал(а):Тебе не нужно делать модель отдельными частями. В OBJ моделях есть ЧАСТИ (parts). Рендер поддерживает работу с отдельными ЧАСТЯМИ ОДНОЙ МОДЕЛИ.
public class RenederTileEntityCommonTest extends TileEntitySpecialRenderer {
public static final IModelCustom model = AdvancedModelLoader.loadModel(new ResourceLocation(SMTCommon.MODID, "model/press01.obj"));
public static final ResourceLocation wood = new ResourceLocation("textures/blocks/planks_oak.png");
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float parTick) {
render((TileEntityCommonTest)tile, x, y, z, parTick);
}
private void render(TileEntityCommonTest tile, double x, double y, double z, float parTick) {
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glTranslatef(0.5F, 0.0F, 0.5F);
Minecraft.getMinecraft().renderEngine.bindTexture(wood);
model.renderPart("body");
model.renderPart("cap");
model.renderPart("sticks");
GL11.glPushMatrix();
float tranl = (0.75F / 40F) * Math.abs(tile.time - 40);
GL11.glTranslatef(0.0F, -tranl, 0.0F);
model.renderPart("plate");
model.renderPart("val_down");
model.renderPart("val_up");
model.renderPart("vint");
GL11.glPopMatrix();
GL11.glPopMatrix();
}
public class TileEntityCommonTest extends TileEntity {
public TileEntityCommonTest() {
}
public void updateEntity() {
if (time >= 20 * 4) time = 0;
++time;
}
}
как ты разделил модель на части?
Код:public class RenederTileEntityCommonTest extends TileEntitySpecialRenderer { public static final IModelCustom model = AdvancedModelLoader.loadModel(new ResourceLocation(SMTCommon.MODID, "model/press01.obj")); public static final ResourceLocation wood = new ResourceLocation("textures/blocks/planks_oak.png"); @Override public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float parTick) { render((TileEntityCommonTest)tile, x, y, z, parTick); } private void render(TileEntityCommonTest tile, double x, double y, double z, float parTick) { GL11.glPushMatrix(); GL11.glTranslated(x, y, z); GL11.glTranslatef(0.5F, 0.0F, 0.5F); Minecraft.getMinecraft().renderEngine.bindTexture(wood); model.renderPart("body"); model.renderPart("cap"); model.renderPart("sticks"); GL11.glPushMatrix(); float tranl = (0.75F / 40F) * Math.abs(tile.time - 40); GL11.glTranslatef(0.0F, -tranl, 0.0F); model.renderPart("plate"); model.renderPart("val_down"); model.renderPart("val_up"); model.renderPart("vint"); GL11.glPopMatrix(); GL11.glPopMatrix(); }
Лучше делать перемещение в радианах или типа того и ещё parTick, дабы выглядело перемещение плавно.Код:public class TileEntityCommonTest extends TileEntity { public TileEntityCommonTest() { } public void updateEntity() { if (time >= 20 * 4) time = 0; ++time; } }
[video=youtube]
Это в 3D's Max'е
а в 3d blender есть подобное?и нажимаешь на "Detach