Search code examples
pythonpython-3.xgame-engine

Ursina engine texture mapping


So the problem I'm facing is that I cannot figure out how to apply textures to a model in a way that texture would be different on each side. For example I wanted to create Minecraft like grass blocks with bottom being brown, sides - green and brown and top - green. I already searched up this issue and found that it is possible to use UVs but I cannot figure out how. I already tried creating UV map in Blender then exported it and put it both as a texture and model and other combinations however it did not change the model so I let it be built-in 'cube' and changed just texture but it literally just put the UV's .png file on all sides.


Solution

  • uvs are in model definition not texture.

    make sure that you have only one uv in blender and unwraped model (default cube is not unwraped).

    when you import from blender to ursina it should import uvs as well (around line 224 here)

    then you should apply the texture to mesh