Jump to content

Line System with a UV


Pryme8
 Share

Recommended Posts

I have not tested it, but I was wondering if it was possible to pass a uv to the points on a Line system.
so like the first point would be at 0,0 and the last be at 1,0 or something similar?

I ask because I want to make a line that gets thicker as it gets close the end and this is part of the solution I cam up with.

Unless someone has a better method?

Link to comment
Share on other sites

How about vertex colors or uv's and one Triangle ? if you set vertex colors for your triangle alle the same it should be filled with that color. If you set - for example -  it's vertices correctly you can have a line with increasing thickness:

https://doc.babylonjs.com/how_to/custom

A possible triangle would be:

x = 0, y = 2, z=0

x = 100, y = 3, z=0

x = 100, y = 1, z=0

This would draw a "line" that's 2 units "thick" at it's end and is 100 units "long". If you want to use such a thing you could construct all kinds of lines, like adding a "rounded" head and so on. However this really depends on your needs. By supplying "uv's" you can map anything you want on your triangle.

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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