Jump to content

Texturing Ribbon


Recommended Posts

Hello everybody,

At first,many thanks for all BJS devs and team behind this great framework!

Q: How can be "irregular" ribbon textured,that texture is not stretched?

(per example- simple leaf shape made of Quadratic bezier curves;texture is squashed on its tips..)

Tried to find answer on my own; but had no luck till now,

it could be cause of me and my capabilities;

so,if one exist please do redirect me and I do apologize for asking it again..


Thanks in advance!

Link to comment
Share on other sites

When you use a ribbon, the UVs are computed by default to be stretched on it as if the ribbon were unwrapped. This is why they can differ from what you expect when you fold it to some specific geometry.

That said, you can pass your own UVs as a flat array of Vector2 (each array element being the UVs of each ribbon vertex) with the optional parameter "uvs" : https://github.com/BabylonJS/Babylon.js/blob/master/src/Mesh/babylon.meshBuilder.ts#L141

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...