Jump to content

[Forge 1.10.2] Render white .OBJ model with specified RGB color?


Recommended Posts

Posted (edited)

Hello! How to render a white .OBJ model with specified RGB color?

TESR: https://pastebin.com/AgEhv513

I'm tried this, but It still not works:

Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModel(
                world,
                getBakedModel(),
                world.getBlockState(te.getPos()),
                te.getPos(),
                Tessellator.getInstance().getBuffer(),
                true);
        tessellator.getBuffer().color(0, 255, 0, 255);
        tessellator.draw();

 

Edited by mrAppleXZ
Posted (edited)

I have an on-going project where I use a standard .obj model and have the code create copies of the .obj, .mtl and a .png for particles etc, which includes editing each individual block's colour.
This might be well over-the-top depending on how you want to render this model.

Is the colour permanent? I mean, it does not change?
If so, you would likely only ever need to create a class that implements IBlockColor, override colorMultiplier, and register the class with the wanted block using Minecraft::getBlockColors().
I do this for Items here.
Do note that it wants an integer. either convert your rgb values to one, or create a java.awt.Color with these values, and call getRGB(). (Note, you can also use the constant colours like Color#GREEN etc)

Edited by Matryoshika
  • Like 1

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.