Help with applying a texture

Im trying to make a very simple 2x2x2 cube with textures in his faces.
The texture Im trying to apply is:

My code:

cube = loader.loadModel("cube")
tex = loader.loadTexture("texture_0.png")

The problem is that the cube shows all his faces gray.
If I duplicate texture_0.png six times until texture_5.png, and change:

tex = loader.loadTexture("texture_0.png")

for this

tex = loader.loadCubeMap("texture_#.png")

Then the cube shows all black.
What am I doing wrong??


I’ll take a guess and say that the cube model might not have any texture coordinates (UVs) on it. In this case it would default the coordinates to zero only use one pixel of the texture.
In this case you would have to look at how the model was created and exported and make sure that texture coordinates are being exported properly.

You’re right. I have checked the egg file and it dont have any UV coords.

Is there any tutorials on how to make it on blender? I have tried this: … n-blender/ but the exporter (YABEE) is only exporting the model, when I run it from the blender text editor.

The exporter is probably expecting the UVs to be made in a certain way. You could try reading through the thread about it here in the forum ([url]Yet Another Blender Egg Exporter (YABEE)]) or asking in that thread. If it comes with some documentation have a look in there. I’ve not used the YABEE exporter before, sorry I can’t be more help.

Thanks, I will do that.

it should be presettexture in the model,no matter what the texture was, then it could have the uv coodrs after export.