Jump to content

[Solved] [1.7.10] How to get blender models to render correctly


Recommended Posts

Posted

I have made a blender model and have exported it to a .obj file and blinded it to a tile entity. But it does not render correctly, it's suppose to be a cylinder, but the ends are really weird. One side looks fine:

 

WGUfaFJ.png

 

But the other side looks really weird:

 

H6rrd5d.png

 

Here is my .obj file:

 

 

# Blender v2.76 (sub 0) OBJ File: 'AuraEngine.blend'
# www.blender.org
mtllib AuraEngine.mtl
o Circle.001_Circle.002
v 0.362281 0.012062 -0.375569
v 0.362281 0.085221 -0.368364
v 0.362281 0.155568 -0.347024
v 0.362281 0.220401 -0.312370
v 0.362281 0.277227 -0.265734
v 0.362281 0.323863 -0.208908
v 0.362281 0.358517 -0.144076
v 0.362281 0.379856 -0.073728
v 0.362281 0.387062 -0.000569
v 0.362281 0.379856 0.072589
v 0.362281 0.358517 0.142937
v 0.362281 0.323863 0.207769
v 0.362281 0.277227 0.264596
v 0.362281 0.220401 0.311232
v 0.362281 0.155568 0.345886
v 0.362281 0.085221 0.367225
v 0.362281 0.012062 0.374431
v 0.362281 -0.061097 0.367225
v 0.362281 -0.131445 0.345885
v 0.362281 -0.196277 0.311232
v 0.362281 -0.253103 0.264596
v 0.362281 -0.299739 0.207769
v 0.362281 -0.334393 0.142937
v 0.362281 -0.355733 0.072589
v 0.362281 -0.362938 -0.000570
v 0.362281 -0.355733 -0.073729
v 0.362281 -0.334393 -0.144076
v 0.362281 -0.299739 -0.208909
v 0.362281 -0.253103 -0.265735
v 0.362281 -0.196277 -0.312371
v 0.362281 -0.131444 -0.347024
v 0.362281 -0.061096 -0.368364
vn -1.000000 0.000000 0.000000
usemtl None
s off
f 2//1 1//1 32//1
f 2//1 32//1 31//1
f 3//1 2//1 31//1
f 16//1 14//1 19//1
f 31//1 30//1 29//1
f 4//1 31//1 29//1
f 5//1 4//1 29//1
f 28//1 6//1 29//1
f 4//1 3//1 31//1
f 6//1 28//1 27//1
f 7//1 6//1 27//1
f 7//1 27//1 26//1
f 8//1 7//1 26//1
f 8//1 26//1 25//1
f 9//1 8//1 25//1
f 9//1 25//1 24//1
f 10//1 9//1 24//1
f 10//1 24//1 23//1
f 11//1 10//1 23//1
f 11//1 23//1 22//1
f 12//1 11//1 22//1
f 12//1 22//1 21//1
f 13//1 12//1 21//1
f 13//1 21//1 20//1
f 14//1 13//1 20//1
f 14//1 20//1 19//1
f 18//1 16//1 19//1
f 15//1 14//1 16//1
f 16//1 18//1 17//1
f 6//1 5//1 29//1
o Circle
v -0.351770 -0.001454 -0.375000
v -0.351770 0.071705 -0.367794
v -0.351770 0.142053 -0.346455
v -0.351770 0.206885 -0.311801
v -0.351770 0.263712 -0.265165
v -0.351770 0.310348 -0.208339
v -0.351770 0.345001 -0.143506
v -0.351770 0.366341 -0.073159
v -0.351770 0.373546 -0.000000
v -0.351770 0.366341 0.073159
v -0.351770 0.345001 0.143506
v -0.351770 0.310348 0.208339
v -0.351770 0.263712 0.265165
v -0.351770 0.206885 0.311801
v -0.351770 0.142053 0.346455
v -0.351770 0.071705 0.367794
v -0.351770 -0.001454 0.375000
v -0.351770 -0.074613 0.367794
v -0.351770 -0.144960 0.346455
v -0.351770 -0.209793 0.311801
v -0.351770 -0.266619 0.265165
v -0.351770 -0.313255 0.208339
v -0.351770 -0.347908 0.143506
v -0.351770 -0.369248 0.073159
v -0.351770 -0.376454 -0.000000
v -0.351770 -0.369248 -0.073159
v -0.351770 -0.347908 -0.143507
v -0.351770 -0.313254 -0.208339
v -0.351770 -0.266618 -0.265165
v -0.351770 -0.209792 -0.311801
v -0.351770 -0.144959 -0.346455
v -0.351770 -0.074612 -0.367795
vn -1.000000 0.000000 0.000000
usemtl None
s off
f 34//2 33//2 64//2
f 34//2 64//2 63//2
f 35//2 34//2 63//2
f 48//2 46//2 51//2
f 63//2 62//2 61//2
f 36//2 63//2 61//2
f 37//2 36//2 61//2
f 60//2 38//2 61//2
f 36//2 35//2 63//2
f 38//2 60//2 59//2
f 39//2 38//2 59//2
f 39//2 59//2 58//2
f 40//2 39//2 58//2
f 40//2 58//2 57//2
f 41//2 40//2 57//2
f 41//2 57//2 56//2
f 42//2 41//2 56//2
f 42//2 56//2 55//2
f 43//2 42//2 55//2
f 43//2 55//2 54//2
f 44//2 43//2 54//2
f 44//2 54//2 53//2
f 45//2 44//2 53//2
f 45//2 53//2 52//2
f 46//2 45//2 52//2
f 46//2 52//2 51//2
f 50//2 48//2 51//2
f 47//2 46//2 48//2
f 48//2 50//2 49//2
f 38//2 37//2 61//2
o Cylinder
v -0.375000 0.000000 -0.375000
v 0.375000 -0.000000 -0.375000
v -0.375000 -0.073159 -0.367794
v 0.375000 -0.073159 -0.367794
v -0.375000 -0.143506 -0.346455
v 0.375000 -0.143506 -0.346455
v -0.375000 -0.208339 -0.311801
v 0.375000 -0.208339 -0.311801
v -0.375000 -0.265165 -0.265165
v 0.375000 -0.265165 -0.265165
v -0.375000 -0.311801 -0.208339
v 0.375000 -0.311801 -0.208339
v -0.375000 -0.346455 -0.143506
v 0.375000 -0.346455 -0.143506
v -0.375000 -0.367794 -0.073159
v 0.375000 -0.367794 -0.073159
v -0.375000 -0.375000 -0.000000
v 0.375000 -0.375000 -0.000000
v -0.375000 -0.367794 0.073159
v 0.375000 -0.367795 0.073159
v -0.375000 -0.346455 0.143506
v 0.375000 -0.346455 0.143506
v -0.375000 -0.311801 0.208339
v 0.375000 -0.311801 0.208339
v -0.375000 -0.265165 0.265165
v 0.375000 -0.265165 0.265165
v -0.375000 -0.208339 0.311801
v 0.375000 -0.208339 0.311801
v -0.375000 -0.143506 0.346455
v 0.375000 -0.143506 0.346455
v -0.375000 -0.073159 0.367794
v 0.375000 -0.073159 0.367794
v -0.375000 0.000000 0.375000
v 0.375000 0.000000 0.375000
v -0.375000 0.073159 0.367794
v 0.375000 0.073159 0.367794
v -0.375000 0.143506 0.346455
v 0.375000 0.143506 0.346455
v -0.375000 0.208339 0.311801
v 0.375000 0.208339 0.311801
v -0.375000 0.265165 0.265165
v 0.375000 0.265165 0.265165
v -0.375000 0.311801 0.208339
v 0.375000 0.311801 0.208339
v -0.375000 0.346455 0.143506
v 0.375000 0.346455 0.143506
v -0.375000 0.367795 0.073159
v 0.375000 0.367795 0.073159
v -0.375000 0.375000 -0.000000
v 0.375000 0.375000 -0.000000
v -0.375000 0.367794 -0.073159
v 0.375000 0.367794 -0.073159
v -0.375000 0.346455 -0.143507
v 0.375000 0.346455 -0.143507
v -0.375000 0.311801 -0.208339
v 0.375000 0.311801 -0.208339
v -0.375000 0.265165 -0.265165
v 0.375000 0.265165 -0.265165
v -0.375000 0.208338 -0.311801
v 0.375000 0.208338 -0.311801
v -0.375000 0.143506 -0.346455
v 0.375000 0.143506 -0.346455
v -0.375000 0.073158 -0.367795
v 0.375000 0.073158 -0.367795
vn -0.000000 -0.098000 -0.995200
vn -0.000000 -0.290300 -0.956900
vn -0.000000 -0.471400 -0.881900
vn -0.000000 -0.634400 -0.773000
vn -0.000000 -0.773000 -0.634400
vn -0.000000 -0.881900 -0.471400
vn -0.000000 -0.956900 -0.290300
vn -0.000000 -0.995200 -0.098000
vn -0.000000 -0.995200 0.098000
vn -0.000000 -0.956900 0.290300
vn -0.000000 -0.881900 0.471400
vn -0.000000 -0.773000 0.634400
vn -0.000000 -0.634400 0.773000
vn -0.000000 -0.471400 0.881900
vn 0.000000 -0.290300 0.956900
vn 0.000000 -0.098000 0.995200
vn 0.000000 0.098000 0.995200
vn 0.000000 0.290300 0.956900
vn 0.000000 0.471400 0.881900
vn 0.000000 0.634400 0.773000
vn 0.000000 0.773000 0.634400
vn 0.000000 0.881900 0.471400
vn 0.000000 0.956900 0.290300
vn 0.000000 0.995200 0.098000
vn 0.000000 0.995200 -0.098000
vn 0.000000 0.956900 -0.290300
vn 0.000000 0.881900 -0.471400
vn 0.000000 0.773000 -0.634400
vn 0.000000 0.634400 -0.773000
vn 0.000000 0.471400 -0.881900
vn 1.000000 -0.000000 0.000000
vn 0.000000 0.098000 -0.995200
vn -0.000000 0.290300 -0.956900
vn -1.000000 0.000000 -0.000000
usemtl None
s off
f 65//3 66//3 68//3 67//3
f 67//4 68//4 70//4 69//4
f 69//5 70//5 72//5 71//5
f 71//6 72//6 74//6 73//6
f 73//7 74//7 76//7 75//7
f 75//8 76//8 78//8 77//8
f 77//9 78//9 80//9 79//9
f 79//10 80//10 82//10 81//10
f 81//11 82//11 84//11 83//11
f 83//12 84//12 86//12 85//12
f 85//13 86//13 88//13 87//13
f 87//14 88//14 90//14 89//14
f 89//15 90//15 92//15 91//15
f 91//16 92//16 94//16 93//16
f 93//17 94//17 96//17 95//17
f 95//18 96//18 98//18 97//18
f 97//19 98//19 100//19 99//19
f 99//20 100//20 102//20 101//20
f 101//21 102//21 104//21 103//21
f 103//22 104//22 106//22 105//22
f 105//23 106//23 108//23 107//23
f 107//24 108//24 110//24 109//24
f 109//25 110//25 112//25 111//25
f 111//26 112//26 114//26 113//26
f 113//27 114//27 116//27 115//27
f 115//28 116//28 118//28 117//28
f 117//29 118//29 120//29 119//29
f 119//30 120//30 122//30 121//30
f 121//31 122//31 124//31 123//31
f 123//32 124//32 126//32 125//32
f 127//34 128//34 66//34 65//34
f 125//35 126//35 128//35 127//35

 

 

And my renderer class:

 

 

package net.sparklepopprograms.enchantedaura.render;

import org.lwjgl.opengl.GL11;

import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import net.sparklepopprograms.enchantedaura.EnchantedAura;

public class AuraEngineRender extends TileEntitySpecialRenderer {

ResourceLocation modelTexture;
ResourceLocation objModelLocation;
IModelCustom model;

public AuraEngineRender(String texture) {
	super();
	modelTexture = new ResourceLocation(EnchantedAura.modid + ":textures/blocks/" + texture + ".png");
    objModelLocation = new ResourceLocation(EnchantedAura.modid + ":models/blocks/AuraEngine.obj");
    model = AdvancedModelLoader.loadModel(objModelLocation);
}

@Override
public void renderTileEntityAt(TileEntity te, double posX, double posY, double posZ, float p_147500_8_) {

	GL11.glPushMatrix();
	GL11.glTranslated(posX + 0.5, posY + 0.5, posZ + 0.5);

	bindTexture(modelTexture);
	model.renderAll();

	GL11.glPopMatrix();

}

}

 

Posted

I got it to work by adding

GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDepthMask(true);

bindTexture(modelTexture);
model.renderAll();

GL11.glPopAttrib();

to my code.

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.