i’m using ExtrudeShape tool to build my custom mesh and i’d like to apply texture only on some face.
From doc i know that i’ve to use frontUVs or backUVs to choose on which side apply the UV map, but how to apply on a specific face? In this example PG Babylon.js Playground i try to apply the texture only to the most external side of the torus (like it was a car wheel) but i don’t understand how to set the UVs. Any changes to Vector4 UV seems to have no effects.
Thanks in advance.
To make changes to such things as vertex colours the mesh needs to be updatable.
Also only a limited set of meshes have the capability of using faceColors
The following meshes have identifiable faces: box; cylinder; extruded polygon and polyhedron have identifiable faces and have the faceUV and faceColors parameters in the options using the MeshBuilder method to create them.
Other than this you would need to know the indices for a particular face and change the VertexData
Heya, here’s a little example of updating the vertex data to give the inner part a solid color. It works by testing the vertex position to see if it’s on the inner part before changing its uvs (you can change the uv coordinates to get a different solid color).
Thank you guys, understood