MCPcopy Create free account
hub / github.com/TheRealMJP/Shadows / BarycentricToCartesian

Function BarycentricToCartesian

Shadows/SampleFramework11/Utility.cpp:57–63  ·  view source on GitHub ↗

Converts from barycentric to cartesian coordinates

Source from the content-addressed store, hash-verified

55
56// Converts from barycentric to cartesian coordinates
57XMFLOAT2 BarycentricToCartesian(const XMFLOAT3& r, const XMFLOAT2& pos1, const XMFLOAT2& pos2, const XMFLOAT2& pos3)
58{
59 float x = r.x * pos1.x + r.y * pos2.x + r.z * pos3.x;
60 float y = r.x * pos1.y + r.y * pos2.y + r.z * pos3.y;
61
62 return XMFLOAT2(x, y);
63}
64
65// Converts from barycentric to cartesian coordinates
66XMVECTOR BarycentricToCartesian(const XMFLOAT3& r, FXMVECTOR pos1, FXMVECTOR pos2, FXMVECTOR pos3)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected