B
B
black_list_man2020-09-17 22:29:23
Graphic arts
black_list_man, 2020-09-17 22:29:23

How to draw a repeating texture along a line/polygon path?

That's what I mean. Moreover, the pattern should not start over from each top, it should continue. It is also noticeable how the dotted line works.
3C9dx.png
As far as I understand, it is impossible to bind a texture of arbitrary height directly to a line, because the line width is limited. To do this, triangulate each segment of the line and apply a texture to the polygons.
I solved the issue with triangulation in this way:
1Fc6F.png
Drawing the resulting array of points through

GL_TRIANGLE_STRIP
- I get a line of arbitrary width. It remains only to apply the texture in the right way. But with the texture coordinates, I'm completely confused.
No matter how I tried, but even on the example of one segment it does not work. the texture is smudged and broken.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question