1

3d rendered tool

Latiodile 7/24/15 1:20 pm
1.3k
8/15/2015 5:01 pm
i want to make a 3d item model, i already have the model, the texture and the tool class but i dont know where to start on making the model for the item in game appear. anyone know how to make a 3d tool that renders when held and dropped?
Posted by
Latiodile
Level 16 : Journeyman Dragon
52

  Have something to say?

JoinSign in

15

QuickScoP3s
08/15/2015 5:01 pm
Level 55 : Grandmaster Programmer
Try making a simple mod with a basic item and block in 1.8 by using the source code and then implement this in your current mod
If you want, private message me and I can provide you with a sample item and block mod for 1.8 (over a few hours, as it is 11 PM in Belgium now )
1
QuickScoP3s
08/15/2015 4:59 pm
Level 55 : Grandmaster Programmer
It's not that hard, try looking at the basic items in the source code! I directly stopped using 1.7, because once you learn how the json works, it is very easy to make it work
1
QuickScoP3s
08/15/2015 4:20 pm
Level 55 : Grandmaster Programmer
In what MC version are you working, because in 1.8 you can use json files to render 3D items, which is very easy!!!
1
Latiodile
08/15/2015 4:45 pm
Level 16 : Journeyman Dragon
1.7.10. i have no knowledge on json.. let alone make a model with it.. i cant even get 1.8 to load a texture with it
1
Anxiety Opossum
08/13/2015 10:00 pm
Level 74 : Legendary Pixel Painter
Oh, by the way, If you ever do figure this out, I'm able to make some models and textures if you ever need the help.
1
Latiodile
08/14/2015 12:58 pm
Level 16 : Journeyman Dragon
seems like itll take a while :/ no one here, on the MCF or forge forums are seeing my forum post :/
1
Latiodile
08/07/2015 2:44 pm
Level 16 : Journeyman Dragon
ok, i got the screenshots and im giving out my renderer code, and my model code
the matter manipulator texture is temporary (unless you want to keep it.. )
First Person mode


Third Person mode


and the techne model (complete with texture!)


Renderer class
Click to reveal
package net.Ethereal.main;

import org.lwjgl.opengl.GL11;

import net.Ethereal.itemblocks.MatterManipModel;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;

public class ItemRenderEMM implements IItemRenderer {

protected MatterManipModel ModelTool;

public ItemRenderEMM() {
ModelTool = new MatterManipModel();

}

@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
switch(type){
case EQUIPPED_FIRST_PERSON:
return true;
case EQUIPPED:
return true;
default: return false;
}
}

@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,
ItemRendererHelper helper) {
return false;
}

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch(type){
case EQUIPPED_FIRST_PERSON:
case EQUIPPED:
GL11.glPushMatrix();
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(EtherealStrings.modid, "textures/models/emmmodeltex.png"));

GL11.glTranslatef(-6.0F, 11.0F, -0.5F);
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);

ModelTool.render((Entity)data[1], 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0625f);

GL11.glPopMatrix();
default:
break;
}
}

}


Model class
Click to reveal
package net.Ethereal.itemblocks;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;

public class MatterManipModel extends ModelBase
{
//fields
ModelRenderer MMHandle;
ModelRenderer MMToolFront;
ModelRenderer MMFrontHandle;
ModelRenderer MMBackAngle;
ModelRenderer MMBackHandle;
ModelRenderer MMFrontAngle;

public MatterManipModel()
{
textureWidth = 64;
textureHeight = 64;

MMHandle = new ModelRenderer(this, 0, 0);
MMHandle.addBox(0F, 0F, 0F, 1, 1, 4);
MMHandle.setRotationPoint(0F, 0F, 0F);
MMHandle.setTextureSize(64, 64);
MMHandle.mirror = true;
setRotation(MMHandle, 0F, 0F, 0F);
MMToolFront = new ModelRenderer(this, 14, 4);
MMToolFront.addBox(0F, 0F, 0F, 2, 1, 4);
MMToolFront.setRotationPoint(-1F, 3F, 0F);
MMToolFront.setTextureSize(64, 64);
MMToolFront.mirror = true;
setRotation(MMToolFront, 0F, 0F, 0F);
MMFrontHandle = new ModelRenderer(this, 0, 5);
MMFrontHandle.addBox(0F, 0F, 0F, 2, 3, 1);
MMFrontHandle.setRotationPoint(-1F, 0F, -1F);
MMFrontHandle.setTextureSize(64, 64);
MMFrontHandle.mirror = true;
setRotation(MMFrontHandle, 0F, 0F, 0F);
MMBackAngle = new ModelRenderer(this, 0, 9);
MMBackAngle.addBox(0F, 0F, 0F, 3, 2, 1);
MMBackAngle.setRotationPoint(-1.466667F, 2F, 4.466667F);
MMBackAngle.setTextureSize(64, 64);
MMBackAngle.mirror = true;
setRotation(MMBackAngle, -0.7853982F, 0F, 0F);
MMBackHandle = new ModelRenderer(this, 7, 9);
MMBackHandle.addBox(0F, 0F, 0F, 2, 3, 1);
MMBackHandle.setRotationPoint(-1F, 0F, 4F);
MMBackHandle.setTextureSize(64, 64);
MMBackHandle.mirror = true;
setRotation(MMBackHandle, 0F, 0F, 0F);
MMFrontAngle = new ModelRenderer(this, 0, 13);
MMFrontAngle.addBox(0F, 0F, 0F, 3, 2, 1);
MMFrontAngle.setRotationPoint(-1.5F, 3F, -1.5F);
MMFrontAngle.setTextureSize(64, 64);
MMFrontAngle.mirror = true;
setRotation(MMFrontAngle, 0.7853982F, 0F, 0F);
}

public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, Entity ent)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
MMHandle.render(f5);
MMToolFront.render(f5);
MMFrontHandle.render(f5);
MMBackAngle.render(f5);
MMBackHandle.render(f5);
MMFrontAngle.render(f5);
}

private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}


}


my client proxy class
Click to reveal
package net.Ethereal.main;

import java.util.HashMap;
import java.util.Map;

import net.Ethereal.armor.ArmorModel;
import net.Ethereal.armor.ArmorModelBackup;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.item.Item;
import net.minecraftforge.client.MinecraftForgeClient;

public class ClientProxy extends ServerProxy {
public static final Map<Item, ModelBiped> armorModels = new HashMap<Item, ModelBiped>();

public static void register_renderers(){

MinecraftForgeClient.registerItemRenderer(EtherealMain.toolEtherealMM, new ItemRenderEMM());
ArmorModel custom_armor = new ArmorModel(1F);
ArmorModel custom_legs = new ArmorModel(0.5F);

armorModels.put(EtherealMain.itemEtherealHelm, custom_armor);
armorModels.put(EtherealMain.itemEtherealChestplate, custom_armor);
armorModels.put(EtherealMain.itemEtherealPants, custom_legs);
armorModels.put(EtherealMain.itemEtherealBoots, custom_armor);


}

}
1
Latiodile
08/07/2015 2:06 pm
Level 16 : Journeyman Dragon
aeropulseAlso, nice Avali icon

im surprised at how many people recognize it xD
im downloading java again and opening up the workplace and gonna post some screenshots so you know sorta whats going on
1
Anxiety Opossum
08/03/2015 7:35 pm
Level 74 : Legendary Pixel Painter
I can't help with rendering, but I have a small amount of info on random generation. I haven't ever programmed java, but I know a bit of lua, after making a few audiosurf skins, and maybe you can do something similar with this. You might be able to assign each part model with a number. The code for the final item could have a few sections that have a randomly assigned number. depending on the number, it will show up as the model that corresponds with it. Sorry if that came out as a bit confusing, or if it didn't help at all, again, I don't know java, but I'll do my best to help.

Also, nice Avali icon
1
RCXcrafter
08/03/2015 6:51 pm
Level 53 : Grandmaster Cyborg
I found this: https://www.youtube.com/watch?v=_VdUo84dKcU
Maybe it's helpful.
1
TheUnderTaker11
08/03/2015 4:25 pm
Level 1 : New Network
is this a mod? or are you trying to get it to work on a vanilla texture?
if its a mod after you created your item you can add a method found in ItemTool that will make it render like a tool, and not like a regular item, once again not exactly sure what you are going for
1
Latiodile
07/24/2015 4:29 pm
Level 16 : Journeyman Dragon
got the item model in, texture set up and everything.... but the model is invisible.... have no idea what to do here.... its invisible in first and third person, i have my render proxy set up and everything
1
Latiodile
07/24/2015 2:39 pm
Level 16 : Journeyman Dragon
lol123406i already have the model, the texture and the tool class

i have techne (which is what i made the model with). im experimenting on getting the item rendered, i have a tutorial open and hoping that works
1
Johnanater
07/24/2015 2:34 pm
Level 15 : Journeyman Taco
If it's the model making. You can use Tehcne
http://techne.zeux.me/
1
Latiodile
07/24/2015 2:00 pm
Level 16 : Journeyman Dragon
also i want to make a tool procedurally generated when crafted, like starbound tools are randomized. for example you craft a pickaxe from a single recipe, and a random one comes up, randomized textures random enchants (if lucky) and maybe random names from a list of words EDIT: and you can find really rare ones in dungeon chests and rare mob drops
1

Welcome