cgmath icon indicating copy to clipboard operation
cgmath copied to clipboard

Homogeneous barycentric coordinates

Open Rhuagh opened this issue 7 years ago • 3 comments

Would it make sense to add conversion to and from barycentric coordinates to cgmath?

Rhuagh avatar Sep 16 '17 09:09 Rhuagh

FWIW, I kind of like that idea. I implemented barycentric coordinate computation on top of the Vector classes. I'm not sure if it's necessary to implement a new type, since the coordinate system can be represented in a Vector.

Anyway, it's only about 18 lines of code for the entire implementation.

parasyte avatar Sep 22 '17 01:09 parasyte

Just the computation would be enough, it's still representable as Vector, as you say.

Rhuagh avatar Sep 22 '17 08:09 Rhuagh

Would definitely be cool to see! Just wondering if there is a neat way to fit it into the existing algebraic structures...? Would also be great to see use cases for this (also good to note those down in the documentation).

brendanzab avatar Sep 23 '17 05:09 brendanzab