Hey guys. Really need help with one thing. So I've created a model in Cinema 4D and exported it with Riptide plugin as obj file with mtl. I've also took some code from MCreator to import this model inside the game and render. But this model is rendering very bad. The face side of each "block" of model is not rendering, so I see only the "inside" of every "block".
This is how it looks like:
Main mod class:
@Mod(modid = ExampleMod.MODID, version = ExampleMod.VERSION)
public class ExampleMod
{
public static final String MODID = "examplemod";
public static final String VERSION = "1.0";
@SidedProxy(serverSide = "com.example.examplemod.CommonProxy", clientSide = "com.example.examplemod.ClientProxy")
public static CommonProxy proxy;
@Instance(MODID)
public static ExampleMod instance;
BlockBigTable bigTable = new BlockBigTable();
//BlockTableChair tableChair = new BlockTableChair();
@EventHandler
public void load(FMLInitializationEvent event) {
if (event.getSide() == Side.CLIENT) {
OBJLoader.INSTANCE.addDomain("examplemod");
}
bigTable.load(event);
//mcreator_1.load(event);
proxy.registerRenderers(this);
}
@EventHandler
public void serverLoad(FMLServerStartingEvent event) {
bigTable.serverLoad(event);
}
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
bigTable.instance = this.instance;
bigTable.preInit(event);
}
}
Block class:
public class BlockBigTable {
public BlockBigTable() {
}
public static BlockBigtable block;
public static Object instance;
public void registerRenderers() {
}
public void serverLoad(FMLServerStartingEvent event) {
}
public void preInit(FMLPreInitializationEvent event) {
}
public void load(FMLInitializationEvent event) {
if (event.getSide() == Side.CLIENT) {
Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
.register(Item.getItemFromBlock(block), 0, new ModelResourceLocation("examplemod:Bigtable", "inventory"));
}
}
static {
block = (BlockBigtable) (new BlockBigtable().setUnlocalizedName("Bigtable")
.setCreativeTab(CreativeTabs.BUILDING_BLOCKS));
}
static class BlockBigtable extends Block {
protected BlockBigtable() {
super(Material.GROUND);
GameRegistry.registerBlock(this, "Bigtable");
setSoundType(SoundType.WOOD);
}
@Override
public boolean isOpaqueCube(IBlockState state) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
return false;
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
return new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D);
}
}
}
Did this happened to anyone? I'm very confused with this issue, I've spent a lot of time trying to find the fix in google.
P.S. I know there's a lot of useless lines, I'll delete them later.
I've encountered the same problem with a multiblock I've created. The faces are rendered only if looked at from the opposite direction: in other words, I can see the faces that I shouldn't see (the ones inside the block), but I can't see the ones outside.
Sorry if I came late, but I've found a solution. Apparently, the face normals are flipped. I've made the model in Blender and I had the same issue. After some research (not looking for minecraft models only), I found this thread:Unity does not render both sides of a plane on http://answers.unity3d.com.
Basically the problem is that the Normals of some/all faces are flipped. There's an easy fix on blender and I assume there's one on Cinema 4D too (or you can import the .obj file on Blender and fix it there). In blender, go into Edit mode, select all the faces (pressing A), then go to Mesh > Normals > Flip Normals: this flips the face normals. Now my model is fully working. You can also select "Recalculate Outside" instead of just "flip": I don't know if it works well, but maybe you want to give it a try.
I hope I've helped, even if I'm late.
Hey guys. Really need help with one thing. So I've created a model in Cinema 4D and exported it with Riptide plugin as obj file with mtl. I've also took some code from MCreator to import this model inside the game and render. But this model is rendering very bad. The face side of each "block" of model is not rendering, so I see only the "inside" of every "block".
This is how it looks like:
Main mod class:
Block class:
Did this happened to anyone? I'm very confused with this issue, I've spent a lot of time trying to find the fix in google.
P.S. I know there's a lot of useless lines, I'll delete them later.Have you found a solution?
I've encountered the same problem with a multiblock I've created. The faces are rendered only if looked at from the opposite direction: in other words, I can see the faces that I shouldn't see (the ones inside the block), but I can't see the ones outside.
Sorry if I came late, but I've found a solution. Apparently, the face normals are flipped. I've made the model in Blender and I had the same issue. After some research (not looking for minecraft models only), I found this thread:Unity does not render both sides of a plane on http://answers.unity3d.com.
Basically the problem is that the Normals of some/all faces are flipped. There's an easy fix on blender and I assume there's one on Cinema 4D too (or you can import the .obj file on Blender and fix it there). In blender, go into Edit mode, select all the faces (pressing A), then go to Mesh > Normals > Flip Normals: this flips the face normals. Now my model is fully working. You can also select "Recalculate Outside" instead of just "flip": I don't know if it works well, but maybe you want to give it a try.
I hope I've helped, even if I'm late.
Fixed