- Home /
UV mapping on runtime mesh
Hi,
I am trying to create skid marks using dynamic meshes in a car driving kind of setup. When the car is braked, I want to show skid marks on the ground. The approach I have take is the create a mesh each time the car breaks and add triangles to the mesh as it moves forward while breaking.
The problem I am facing is that I do not see the skid mark texture at all on the mesh I am generating. I am not going to post code, but I need to know how uv mapping happens in case one generating meshes at run time, also how does the tiling and offset value work ?
$$anonymous$$esh.uv is an array of Vector2s. Each element corresponds to element of the same index in the $$anonymous$$esh.vertices array. The Vector2 values go from 0.0 to 1.0 (anything higher or lower wraps), and describe where the vertex is on the texture bitmap. So, a simple quad mesh with four vertices and a square bitmap as a texture could have uvs like this: 0.0 0.1 1.1 1.0
Your answer
Follow this Question
Related Questions
Adding extra materials to a mesh programmatically 0 Answers
UV Mapping a Sphere at runtime 1 Answer
Modifying just one mesh and not all instances? 2 Answers
Manual UV-Mapping of a Primitive Cube 1 Answer
No Procedural Terrain without lags? 2 Answers