Re: Rectangles and Gradients

[email protected] Wed, 16 Oct 2019 17:41:40 +0000 (UTC)
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
--===============0486985516==
Content-Type: multipart/alternative; 
	boundary="----=_Part_3562991_1259158622.1571247700455"

------=_Part_3562991_1259158622.1571247700455
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

 
Hi Uli,

Yes, create a 90 degree line from one line and compute the intersection with the other parallel line of the sheared rectangle. This will give the linear gradient control line. This works in affine space. A little funky with a perspective matrix. Mesh gradients work better there. It should be possible to use the mapped 3d to 2d matrix to do the same with cairo_pattern_set_matrix(). This is what I did with fonts but haven't been able to figure it out for linear gradients. A flat rectangle on the yz plane rotated in 3d should map to the xy plane in 2d. For now, a little geometry will have to do.

Thanks,
Eric
 


------=_Part_3562991_1259158622.1571247700455
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit


<div style="color:black;font: 10pt arial;">
<div> <font size="2"><br>
Hi Uli,<br>
<br>
Yes, create a 90 degree line from one line and compute the intersection with the other parallel line of the sheared rectangle. This will give the linear gradient control line. This works in affine space. A little funky with a perspective matrix. Mesh gradients work better there. It should be possible to use the mapped 3d to 2d matrix to do the same with cairo_pattern_set_matrix(). This is what I did with fonts but haven't been able to figure it out for linear gradients. A flat rectangle on the yz plane rotated in 3d should map to the xy plane in 2d. For now, a little geometry will have to do.<br>
<br>
Thanks,<br>
Eric</font><br>
</div>

<div> <br>
</div>
<br>
</div>

------=_Part_3562991_1259158622.1571247700455--

--===============0486985516==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

LS0gCmNhaXJvIG1haWxpbmcgbGlzdApjYWlyb0BjYWlyb2dyYXBoaWNzLm9yZwpodHRwczovL2xp
c3RzLmNhaXJvZ3JhcGhpY3Mub3JnL21haWxtYW4vbGlzdGluZm8vY2Fpcm8=

--===============0486985516==--