Generate UVs along flat procedural generated street mesh
Hey,
I'm having trouble to generate UVs for my street mesh that is generated during runtime using a Catmullrom curve.
The user specifies >= 2 points and from that a cutmullrom curve is generated. I extract a reasonable amount of points along the curve to iterate over and generate a mesh out of it as shown below.
For every point a perpendicular direction is calculated and thus two vertices generated, one for every side. The triangulation happens as shown above.
How would I calculate the UVs for a mesh with more than 2 control points ( 2 points would just be a straight line) ? Note that the mesh is always flat. The normals are oriented in the Up-direction.
Answer by moepmoep12 · Nov 21, 2018 at 04:51 PM
I've found the solution shortly after posting this.
I'ts actually quite simple. I tried to explain it in the image.
It works for curves too.
Your answer
Follow this Question
Related Questions
Assigning uvs to "procedural" mesh. 2 Answers
Assigning uv's to multiple faces 1 Answer
Tiling UV mapping? 3 Answers
Why isn't the different blocks/textures working? 0 Answers
Can someone help with applying a generated texture onto a generated mesh? 1 Answer