It now looks like I have a new challenge.  The masking is working well for one rectangle, but what I need is when there&#39;s two rectangles on the screen, that the border of one rectangle is visible in the middle of the other, and vise versa.  Right now, the middle of one rectangle blocks out border of another.  It looks like I might have to build each rectangle using 4 put together, but I wanted to avoid this for asthetics&#39; sake.<div>
<br></div><div>Again thanks for all your help.  So there doesn&#39;t seem to be a [disk] object but with adjustable sides?  Maybe I should start learning how to write an external.</div><div><br></div><div>Cheers! <br><br>
<div class="gmail_quote">On Sat, Jun 12, 2010 at 5:06 PM, Ryan Trigg <span dir="ltr">&lt;<a href="mailto:ryan.trigg@gmail.com">ryan.trigg@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Thank you to all for being so helpful!  Cyrille, that looks exactly what I&#39;m looking for.  I can stop pulling the hair out of my head.<div><br></div><div>Thanks again everyone.</div><div><br></div><div>Cheers!</div><div>

<br></div><div><font color="#888888">Ryan</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">On Sat, Jun 12, 2010 at 2:23 AM, cyrille henry <span dir="ltr">&lt;<a href="mailto:ch@chnry.net" target="_blank">ch@chnry.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Le 12/06/2010 11:17, Jack a écrit :<div><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Yes it is working fine ;)<br>
I thought about a solution without the translation.<br>
</blockquote></div>
without the translation, it could work, but i&#39;m not sure the result will be the same on every GPU.<div><div></div><div><br>
<br>
c<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This is a nice example for the importance of the rendering order.<br>
++<br>
<br>
Jack<br>
<br>
<br>
<br>
Le samedi 12 juin 2010 à 09:25 +0200, cyrille henry a écrit :<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
hello,<br>
<br>
i may have misunderstood the question, because i think there is a much simple solution using rendering order.<br>
see attachment.<br>
c<br>
<br>
<br>
Le 12/06/2010 07:05, patko a écrit :<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
hi again,<br>
<br>
   after reflexion, I don&#39;t think it&#39;s a good idea to snap and apply alpha<br>
when you want to apply a texture on the outer rectangle, some pixels might<br>
disappear when they have the same amount of color that is supposed to disappear on the masking process.<br>
<br>
It might be possible to apply a texture mapping on vertices drawn with openGL functions rather,<br>
but I&#39;ve no clue about how it could be done yet.<br>
<br>
   Or just use the method proposed by jack that is about using four rectangles if you don&#39;t use a texture, you can connect them together like this:<br>
<br>
[gemhead]<br>
|<br>
[translateXYZ -1 0 0]<br>
|<br>
[rectangle 0.2 1]<br>
|<br>
[translateXYZ 0.8 1 0]<br>
|<br>
[rectangle 1 0.2]<br>
|<br>
etc...<br>
<br>
<br>
<br>
   Just loading an image containing the alpha hole, like attached would be cpu wise, very simple to do with an image editor,<br>
and wouldn&#39;t add artefacts on your texture.<br>
   I&#39;ve attached an example patch and the gimp image, on gimp just draw the two rectangles, select the inner rectangle, go to Colors menu,<br>
and then choose &quot;Color to alpha&quot;.<br>
   I&#39;ve choosen the tiff format because it works on most platforms, unlike png.<br>
<br>
Patrice Colet - 06 32 66 03 57<br>
<br>
----- &quot;Jack&quot;&lt;<a href="mailto:jack@rybn.org" target="_blank">jack@rybn.org</a>&gt;   a écrit :<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
You have several possibilities to do what you are looking for :<br>
- use (as Patrick describe) two rectangles to create a mask (with<br>
[gemframebuffer], [pix_snap] and [pix_buffer], [pix_buffer_read],<br>
[pix_buffer_write]) then [pix_mask] or [pix_multiply];<br>
- use four [rectangle]s to build &#39;lines&#39; of the rectangle;<br>
- use GLSL to create the mask and the final image.<br>
Surely, there are other ways (like openGL objects with GEM for<br>
example)...<br>
See in help&gt;   browser&gt;   examples&gt;   GEM (in Pd-extended) to understand<br>
what this objects do.<br>
Hope that helps somewhat.<br>
++<br>
<br>
Jack<br>
<br>
<br>
<br>
<br>
Le vendredi 11 juin 2010 à 10:03 -0700, Ryan Trigg a écrit :<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Patrice,<br>
<br>
<br>
Thanks for your reply, sounds like interesting options (especially<br>
</blockquote>
the<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
snapping two rectangles together)...could you be more specific with<br>
instructions on what objects to use?  Pardon my novice GEM skills.<br>
<br>
<br>
Merci!<br>
<br>
<br>
Ryan<br>
<br>
On Fri, Jun 11, 2010 at 9:49 AM, patko&lt;<a href="mailto:colet.patrice@free.fr" target="_blank">colet.patrice@free.fr</a>&gt;<br>
</blockquote>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
          hello,<br>
           you can put an image texture with a rectangle made of<br>
</blockquote>
alpha<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
          pixels,<br>
           or draw an alpha rectangle using  gridflow and then load<br>
</blockquote>
it<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
          as a texture<br>
          with #to_pix,<br>
           or snap two rectangles with different colors,<br>
           and turn to alpha all pixels matching the inner rectangle.<br>
<br>
          Patrice Colet - 06 32 66 03 57<br>
<br>
          ----- &quot;Ryan Trigg&quot;&lt;<a href="mailto:ryan.trigg@gmail.com" target="_blank">ryan.trigg@gmail.com</a>&gt;   a écrit :<br>
<br>
<br>
          &gt;   I am trying to mask [rectangle] using GEM with another<br>
          smaller<br>
          &gt;   [rectangle] (that controls the first rectangle&#39;s alpha<br>
</blockquote>
value<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
          wherever<br>
          &gt;   it is placed) in order to create an adjustable rectangle<br>
          outline (that<br>
          &gt;   has a border of my desired thickness). I noticed that you<br>
          can choose<br>
          &gt;   [draw line( and [width $1( for a rectangle but the<br>
</blockquote>
maximum<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
          thickness<br>
          &gt;   of the line is much too small. Does anyone have any<br>
</blockquote>
thoughts<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
          or ideas?<br>
          &gt;<br>
          &gt;<br>
          &gt;   Or maybe there&#39;s an object like [disk] (using 4 segments)<br>
          but with the<br>
          &gt;   ability to adjust the height and width just like<br>
</blockquote>
[rectangle]<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
          &gt;<br>
          &gt;<br>
          &gt;<br>
          &gt;   Cheers!<br>
          &gt;<br>
          &gt;<br>
          &gt;   Ryan<br>
<br>
          &gt;   _______________________________________________<br>
          &gt;   <a href="mailto:Pd-list@iem.at" target="_blank">Pd-list@iem.at</a> mailing list<br>
          &gt;   UNSUBSCRIBE and account-management -&gt;<br>
          &gt;   <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br>
<br>
_______________________________________________<br>
<a href="mailto:Pd-list@iem.at" target="_blank">Pd-list@iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -&gt;<br>
</blockquote>
<a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br>
<br>
_______________________________________________<br>
<a href="mailto:Pd-list@iem.at" target="_blank">Pd-list@iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -&gt;   <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
</blockquote></blockquote></blockquote>
<br>
<br>
<br>
</blockquote>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>