Tabula icon indicating copy to clipboard operation
Tabula copied to clipboard

[Future Plan/Idea] Model importer

Open ghost opened this issue 10 years ago • 1 comments

I was thinking about importing and using models with animation in Java. And what i thought would be a neat idea, is to write a little API for importing models from actual Tabula files (you save animations already, right?) and rendering them like this:

TabulaModel model = TabulaLoader.load("modid:models/test.tbl");
model.render();
//or
model.renderAnimation(someKindOfTick, etc);
//or using methods from existing Forge framework
model.renderParts("Head", "Neck", "etc");

Also, if this loader gets really popular and stuff, it might be included in forge by default(like Techne model importer, which is broken in Forge from 1.6). And, you are rendering animations in Tabula now, so you can reuse some of that code in this API.

P.S. Just realised, that all this time i was using Russian rules to place commas all around, lol.

ghost avatar Jan 03 '15 02:01 ghost

So far i wrote supercool independent(no Tabula or iChunUtil required) API thingy to load and render models from tbl file and right now i'm working on animations. So, a little example below:

    private final IAnimatedModel model;

    public TestRenderer(){
        model = TabulaLoader.load("testt:models/ModelPig.tbl");
    }

    @Override
    public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTicks){
        GL11.glPushMatrix();
        GL11.glTranslated(x, y, z);
        /* Animations example
         double position = model.getPrevTicks() + (mode.getTicks() - model.getPrevTicks()) * particalTicks;
         model.renderAnimation("testAnim1", position);
        */
        model.renderAll();
        GL11.glPopMatrix();
    }

It would render like this: image

ghost avatar Jan 04 '15 16:01 ghost