mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
![]() Tvg Picture newly provides mesh() api to support texture mapping. These apis allows to have a coarse triangle list which have polygon coordinates and texture uvs those are used for traditional polygon texture mapping. Note that these apis are beta version. @API Additions: Result mesh(const Polygon* triangles, const uint32_t triangleCount) noexcept uint32_t mesh(const Polygon** triangles) const noexcept @Examples: //Mapping with two polygons Polygon polygon[2]; //First polygon polygon[0].vertex[0].pt = {0, 0}; polygon[0].vertex[1].pt = {100, 0}; polygon[0].vertex[2].pt = {0, 100}; polygon[0].vertex[0].uv = {0, 0}; polygon[0].vertex[1].uv = {1, 0}; polygon[0].vertex[2].uv = {0, 1}; //Second polygon polygon[1].vertex[0].pt = {100, 0}; polygon[1].vertex[1].pt = {100, 100}; polygon[1].vertex[2].pt = {0, 100}; polygon[1].vertex[0].uv = {1, 0}; polygon[1].vertex[1].uv = {1, 1}; polygon[1].vertex[2].uv = {0, 1}; //Apply polygons to the picture picture->mesh(polygon, 2); @Issues: https://github.com/Samsung/thorvg/issues/1218 |
||
---|---|---|
.. | ||
meson.build | ||
thorvg.h |