UV wrap not visible

Hi!



I’m fairly new to game programming and I wanted to begin with a simple dice throw simulation. Now I’m pretty much finished, everything is working fine, except for the dice itself:P I created a model in blender (ver. 2.4x) (just a cube, mapped with a dice image I made, using the UV unwrapping thing) which I exported to Ogre XML via the Blender Exporter (I got two files, .material and .mesh.xml). Here’s how I load it into jME:

[java]

Spatial dice_spatial = assetManager.loadModel(“Models/Dice/Cube.mesh.xml”);

dice_spatial.setLocalScale(0.1f);

CollisionShape diceShape = CollisionShapeFactory.createBoxShape((Node) dice_spatial);

dice_phy = new RigidBodyControl(diceShape, 2f);

dice_spatial.addControl(dice_phy);

bulletAppState.getPhysicsSpace().add(dice_phy);

pivot.attachChild(dice_spatial);

[/java]

And I get the cube allright, but it’s just gray, no image on it whatsoever. I should add that I have a light source in my application. What might be the problem?

I’m linking my dice’s blender project, maybe there’s something wrong with it.

http://www.speedyshare.com/files/30395634/dice.blend

you need to rename Scene.material to Cube.material

Did that, in the exporter settings in blender, didn’t change anything:/. Just in case, these are the contents of the .material file:

[xml]

material Material

{

receive_shadows on

technique

{

pass

{

ambient 1.000000 1.000000 1.000000 1.000000

diffuse 0.640000 0.640000 0.640000 1.000000

specular 0.500000 0.500000 0.500000 1.000000 12.500000

emissive 0.000000 0.000000 0.000000 1.000000

}

}

}

[/xml]

Your material doesn’t reference your texture. Notify your .mesh.xml references the UV’s. If yes, create a .j3m material, if not, you are missing something when trying to export.

Make sure your scene looks correct when you render the model in Blender (by pressing F12). As the materials exported are usually rendering materials and not the materials shown in the preview

Yes, the rendered scene looks exactly like I want it to. I gave up on the dice, I just modeled the holes instead of texturing them on:P But same problem is with another model I created and want to load. No UV textures on this one, just normal blender material and some native blender texture with normals. When I load it, it has the correct material pigment, but, again, no texture. I’m linking to my blender model. Could someone please try to export it and load it to jME, see if it works (what settings in exporter)?

http://www.2shared.com/file/_ipNl5Js/board.html

yeh, i’ve always had trouble getting models working properly, the best way i’ve found so far, works almost 100% for me now is:

Use lastest blender

Create a single mesh model, create UV’s, create a png/jpeg texture to model it

Export as .obj, with settings: selection only, apply modifiers, edges, normals, high quality normals, uvs, triangulate, keep vertex order.

Convert to .j3o

Add the textures in code (or maybe create a .j3m file)



It might not be the best way to do it, but it gives me the least problems, (won’t work for animation)

There are two issues with that model:

  1. It uses generated texture coordinates instead of UV coordinates
  2. It uses generated textures instead of image file textures



    The model as it is now, cannot be exported using OgreXML.

    You might want to give the jME3 blender importer a try, which can load the .blend files directly. Note however that it is currently in beta and still has bugs.

Ok. Thanks very much, I will try following your advice:D