mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-24 02:16:32 +11:00
linear algebra refresher
This commit is contained in:
parent
3c15bff867
commit
1f938e5f49
2 changed files with 2 additions and 2 deletions
|
@ -155,7 +155,7 @@ fn main(
|
||||||
inv_det * (matrx.z * translate.y - matrx.w * translate.x),
|
inv_det * (matrx.z * translate.y - matrx.w * translate.x),
|
||||||
inv_det * (matrx.y * translate.x - matrx.x * translate.y),
|
inv_det * (matrx.y * translate.x - matrx.x * translate.y),
|
||||||
);
|
);
|
||||||
inv_tr += p0;
|
inv_tr -= p0;
|
||||||
let center1 = p1 - p0;
|
let center1 = p1 - p0;
|
||||||
let rr = r1 / (r1 - r0);
|
let rr = r1 / (r1 - r0);
|
||||||
let ra_inv = rr / (r1 * r1 - dot(center1, center1));
|
let ra_inv = rr / (r1 * r1 - dot(center1, center1));
|
||||||
|
|
|
@ -251,7 +251,7 @@ fn main(
|
||||||
for (var i = 0u; i < PIXELS_PER_THREAD; i += 1u) {
|
for (var i = 0u; i < PIXELS_PER_THREAD; i += 1u) {
|
||||||
let my_xy = vec2(xy.x + f32(i), xy.y);
|
let my_xy = vec2(xy.x + f32(i), xy.y);
|
||||||
// TODO: can hoist y, but for now stick to the GLSL version
|
// TODO: can hoist y, but for now stick to the GLSL version
|
||||||
let xy_xformed = rad.matrx.xy * my_xy.x + rad.matrx.zw * my_xy.y - rad.xlat;
|
let xy_xformed = rad.matrx.xy * my_xy.x + rad.matrx.zw * my_xy.y + rad.xlat;
|
||||||
let ba = dot(xy_xformed, rad.c1);
|
let ba = dot(xy_xformed, rad.c1);
|
||||||
let ca = rad.ra * dot(xy_xformed, xy_xformed);
|
let ca = rad.ra * dot(xy_xformed, xy_xformed);
|
||||||
let t = sqrt(ba * ba + ca) - ba - rad.roff;
|
let t = sqrt(ba * ba + ca) - ba - rad.roff;
|
||||||
|
|
Loading…
Add table
Reference in a new issue