Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Future Plan/Idea] Model importer #29

Open
ghost opened this issue Jan 3, 2015 · 1 comment
Open

[Future Plan/Idea] Model importer #29

ghost opened this issue Jan 3, 2015 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 3, 2015

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
Copy link
Author

ghost commented Jan 4, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants