Hi everyone, Long time no see. Happy new year!
I’m going to draw a box with different materials on the faces. Could I just use the Box class to creat a geometry and set the materails. Otherwise, I could only draw each face individually.
You should use one UV texture, Materials are per Geometry.
normen said:
You should use one UV texture, Materials are per Geometry.
Thanks, I will try it.
How do you go about applying the UV texture to the box?
You’ll need a 3D modeling application like Blender, Maya or 3DSMax, then you’ll have to learn how to do it. It’s fairly simple, especially on a box, and there are plenty of tutorials for each afford mentioned applications, available via a quick search on google.
Normen’s response made it seem like you could apply a UV Texture to a box?
My issue is in that I can’t apply the texture to the box. I know how to make it.
I’m doing something similar to double1984 and am trying to have a block class with a makeBlock method. It currently works for textures applied to all faces, but it seems this solution won’t work with UVMaps.
If you’re planning on having many of those boxes, then having a separate texture per box face is probably going to kill performance by a lot.
You should consider using a texture atlas instead, then you only use 1 texture per box
iown3ru said:
I'm using culling to hide unviewed blocks, my issue is getting different textures on different sides. So that I can have a grass block with grass on top and dirt elsewhere.
Hi iown3ru. We have got the same problem. if you just want a different texture on the top of the box, it would be easyer to add another flat box or quad on the top of the original one with the texture you want. Maybe you can also build a box in the modeling software like Blender, setup all the textures you want, and then import the model into Jmonkey. I haven't tried this way, but it should work. I have tried to draw every faces of the box separately, but it would take a long time to attach or detach these geometries if you have lots of the boxes when you change the scene.
I’m using culling to hide unviewed blocks, my issue is getting different textures on different sides. So that I can have a grass block with grass on top and dirt elsewhere.