octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patch coloring help


From: Pantxo Diribarne
Subject: Re: patch coloring help
Date: Mon, 9 Dec 2013 18:15:49 +0100




2013/12/9 Rik <address@hidden>
On 12/09/2013 07:18 AM, Michael Goffioul wrote:
On Sun, Dec 8, 2013 at 8:54 PM, Rik <address@hidden> wrote:
On 12/08/2013 12:52 PM, Benjamin Abbott wrote:

On Dec 8, 2013, at 3:39 PM, Pantxo Diribarne <address@hidden> wrote:

Le 08/12/2013 21:23, Ben Abbott a écrit :
On Dec 8, 2013, at 1:39 PM, Rik <address@hidden> wrote:

12/8/13

I'm trying to solve patch coloring inconsistencies between Matlab and
Octave.  Depending on options to OpenGL I can get the bi-linear
interpolation to run on either one of the main diagonals and I want to know
which one Matlab used.  Could someone run the following test script and
then send back a png of the output?

v = [0 0 0;1 0 0;1 1 0;0 1 0];
f = [1 2 3 4];
fvc = [1 0 0;0 1 0;1 0 1;1 1 0];
h = patch ('Vertices',v,'Faces',f,'FaceVertexCData',fvc,
          'FaceColor','flat','EdgeColor','flat',
          'Marker','o','MarkerFaceColor','flat')
set (h, 'facecolor', 'interp');
print -dpng tst_patch.png

Cheers,
Rik

The png is attached.

Ben

On linux, ML R2012a, Interpolation is done along the other diagonal. See attached png.

Pantxo
<tst_patch.png>

Might the difference be due to differences in the OpemGL implementations?

Ben
12/8/13

Maybe it is a difference in face ordering?  Does the coloring change to a different diagonal if you do

set (h, 'faces', [4 3 2 1])

I think the documentation says that it shouldn't make a difference, but I'm seeing one in Octave and so maybe there is one in Matlab as well.

Be careful to compare apples with apples. In other words, you should make sure that Matlab is also using the OpenGL renderer, and not its own painter engine. Results could be different. I remember that when I implemented JHandles, color interpolation results were different when Matlab was using its own painter engine, or OpenGL.

Michael.


Anyone with Matlab access want to comment?  I have a patch ready now that matches Ben's diagonal for interp shading.

--Rik

I have tried at work on an older ML (2008b) intalled on a unix machine. I obtain the same result as on linux (i.e. not the same as mac) and the renderer is automatically set to "zbuffer".
 If I manually change the renderer to "opengl", the result is the same. The "painter" renderer doesn't support rgb so that I could not try it out.

Pantxo

reply via email to

[Prev in Thread] Current Thread [Next in Thread]