Box Texture Query

Hello, I am looking at texturing boxes.
At the moment, I am using the single texture painting the cube, but with offsets to ensure that each surface has a different imprint.

https://playcanvas.com/project/887452/overview/texture-query

Is there’s a better way to define and control the texture mapping to the cube?
Ideally, I would like a situation where we could map three faces of the cube to the following texture with the diamonds mapped to respective faces:

For example:
image

Thank you and regards

Adam Burgess

Hi @adamburgess38,

Isn’t it possible for your project to prepare a cube with that kind of mapping in a modelling app?

After you have that in PlayCanvas the texture will naturally work as expected.

2 Likes

Thank you for your suggestion !

I could go that route but I was hoping to use also dynamically change the associated texture. This would avoid making multiple models since we couldn’t discover the correct way to modify the associated texture when it is linked via a model.

Got it, it’s definitely possible using the Mesh API to set the right UVs per triangle. I don’t have a concrete example in mind, you can work your way through the mesh generation examples here on how to work with it:

https://playcanvas.github.io/#/graphics/mesh-generation

https://developer.playcanvas.com/api/pc.Mesh.html

1 Like

Brilliant, thank you, will look into it soon!