<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237542</link>
    <title>MATLAB Central Newsreader - Redrawing graphics objects</title>
    <description>Feed for thread: Redrawing graphics objects</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 15 Oct 2008 00:12:01 -0400</pubDate>
      <title>Redrawing graphics objects</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237542#605284</link>
      <author>Ryan Ollos</author>
      <description>I have an animation that moves an image around a 2D axes.  I move the image by changing its 'Position' property.  Also in the axes are a number of line objects, positioned vertically.&lt;br&gt;
&lt;br&gt;
The problem I have is that the image is sometimes positioned over vertical lines, and I would like these lines to always be visible.  When the image is position over these lines it hides a portion of the line.&lt;br&gt;
&lt;br&gt;
The only solution I have found is to delete and recreate the lines after the image has changed position.  I was hoping to find a faster (in terms of execution speed) way to do this by something like:&lt;br&gt;
* re-rendering the lines&lt;br&gt;
* somehow controlling the stacking order of objects in the image&lt;br&gt;
* via the EraseMode property&lt;br&gt;
&lt;br&gt;
The closest thing I have come up with is setting the EraseMode of the line objects to 'xor'.  The problem with this is that the lines are not rendered in the specified color, as expected after reading the documentation for EraseMode = 'xor'.&lt;br&gt;
&lt;br&gt;
Any ideas?&lt;br&gt;
&lt;br&gt;
Thanks for your time!</description>
    </item>
    <item>
      <pubDate>Wed, 15 Oct 2008 04:22:38 -0400</pubDate>
      <title>Re: Redrawing graphics objects</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237542#605313</link>
      <author>Walter Roberson</author>
      <description>Ryan Ollos wrote:&lt;br&gt;
&amp;gt; I have an animation that moves an image around a 2D axes.  I move the image by changing its&lt;br&gt;
&amp;gt;  'Position' property.  Also in the axes are a number of line objects, positioned vertically.&lt;br&gt;
&lt;br&gt;
&amp;gt; The problem I have is that the image is sometimes positioned over vertical lines, and I&lt;br&gt;
&amp;gt; would like these lines to always be visible&lt;br&gt;
&lt;br&gt;
Which renderer are you using? If you are using the OpenGL renderer (only), then&lt;br&gt;
the stacking order of lines compared to flat objects at the same Z plane ignored.&lt;br&gt;
-Somewhere- it is documented which will show up on top, but I have found that&lt;br&gt;
in practice it depends upon your graphics drivers and upon your operating system --&lt;br&gt;
e.g., for me on Linux-64 over X, the order is the reverse of what is documented.&lt;br&gt;
&lt;br&gt;
If you are using any renderer other than OpenGL, then the stacking order is&lt;br&gt;
supposedly obeyed... but OpenGL is the only renderer that supports transparency...&lt;br&gt;
In theory if you add a small Z offset to either the line or the image&lt;br&gt;
(or patch) then they will no longer be in the same plane and the one that&lt;br&gt;
is &quot;closer&quot; to the viewpoint will appear &quot;on top&quot;. </description>
    </item>
    <item>
      <pubDate>Wed, 15 Oct 2008 06:26:01 -0400</pubDate>
      <title>Re: Redrawing graphics objects</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237542#605326</link>
      <author>Ryan Ollos</author>
      <description>Walter Roberson &amp;lt;roberson@hushmail.com&amp;gt; wrote in message &amp;lt;SdeJk.734$1r2.316@newsfe01.iad&amp;gt;...&lt;br&gt;
&amp;gt; Which renderer are you using? If you are using the OpenGL renderer (only), then&lt;br&gt;
&amp;gt; the stacking order of lines compared to flat objects at the same Z plane ignored.&lt;br&gt;
&amp;gt; -Somewhere- it is documented which will show up on top, but I have found that&lt;br&gt;
&amp;gt; in practice it depends upon your graphics drivers and upon your operating system --&lt;br&gt;
&amp;gt; e.g., for me on Linux-64 over X, the order is the reverse of what is documented.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If you are using any renderer other than OpenGL, then the stacking order is&lt;br&gt;
&amp;gt; supposedly obeyed... but OpenGL is the only renderer that supports transparency...&lt;br&gt;
&amp;gt; In theory if you add a small Z offset to either the line or the image&lt;br&gt;
&amp;gt; (or patch) then they will no longer be in the same plane and the one that&lt;br&gt;
&amp;gt; is &quot;closer&quot; to the viewpoint will appear &quot;on top&quot;. &lt;br&gt;
&lt;br&gt;
Hi Walter,&lt;br&gt;
&lt;br&gt;
Thank you for the ideas.  I'm on Win Vista, and I tried all 3 renderers.  Zbuffer and OpenGL behave like you described for OpenGL.  It seems like the stacking of the objects is random when using these Renders because there is a lot of flashing as the image updates. &lt;br&gt;
&lt;br&gt;
Adding a zdata offset when using the painters renderer works well.&lt;br&gt;
&lt;br&gt;
It would be nice to figure out a way to control the stacking order when using OpenGL, but I'm very happy this is working with Painters.&lt;br&gt;
&lt;br&gt;
Thanks!</description>
    </item>
  </channel>
</rss>

