Barycentric Genration?

So do we have a way to include Barycentric coordinates in the vertexData just inherently? Currently I parse the data and replace the normal buffer with barycentric info, but it would be nice to keep both. I think I might just have to make a custom Buffer with step for the extra two values.

Just a thought how about storing them in uvs6 for example?

Also less direct but a possibility Use Facet Data - Babylon.js Documentation

oooh good idea uvs6 would be perfect.

We only need the XY value because the coordinates always add up to 1 so z = 1 - x - y which then I could keep the normal data.

Super smart thank you!

Just because it’s labeled uv does not mean you are restricted to the pattern [x,y,x,y,x,y…] as long as you are writing to and reading from the array you can use the pattern [x,y,z,x,y,z…] or any other pattern you want.

https://www.babylonjs-playground.com/#G3GZA1#162

Yeah it worked for sure.

3 Likes