patch function with fltk in 3.1.52+

Kai Habel kai.habel at gmx.de
Mon Mar 2 02:55:03 CST 2009


martin_helm schrieb:
>
> martin_helm wrote:
>   
>> Hello,
>>
>> while trying the patch function (as a substitute for trisurf) with the
>> recent development sources and backend fltk, I noticed a problem with the
>> color settings, the following does what I expect
>>
>> octave:1> backend("fltk")
>> octave:2> T = [1 2 3];
>> octave:3> p = [0 0 0; 0 1 0; 1 1 1];
>> octave:4> patch ('Faces', T, 'Vertices', p, "r")
>>
>> I see a red triangle with black borders. 
>> If I pass an rgb (e. g. [0.5 0.5 0.5] ) vector as the help patch suggests
>> the triangle does not change color (independent of the values).
>> Using 
>>
>> shading flat 
>>
>> to avoid the black borders it leads to a completely black triangle.
>> If I call then again
>>
>> patch ('Faces', T, 'Vertices', p, "r")
>>
>> the colors of border and area are reverted (that means a black triangle
>> with a red border instead of a red triangle with a black border as
>> before).
>>
>> Is there something which I missunderstand or is it simply something which
>> is not yet implemented?
>>
>> I am running linux 2.6.27.7-9-default 64 bit on AMD Athlon Dualcore 2 GHz. 
>>
>> I checked the same with a 3.0.3 version and jhandles 0.3.4 where I can
>> assign different colors to the facets (on WinXP). but shading flat does
>> also not work ( here it throws an exception and does not affect the
>> graphics at all).
>>
>> - mh
>>
>>
>>
>>     
>
> To answer a part of my own question:
>
> I found that 
>
> patch('Faces',T,'Vertices',p,'FaceVertexCData', c, 'FaceColor','flat',
> 'EdgeColor', 'none')
>
> does exactly what I was looking for.
>
> One question remains, what is the intended behaviour if a shading command is
> invoked afterwards?
>
>   
Hello Martin,

patches are not fully implemented for the fltk/OpenGL backend.
<http://dict.leo.org/ende?lp=ende&p=thMx3r&search=unfortunately>Unfortunately,
nobody is working on this currently, so any help is welcome. And yes ...
in the end it should be compatible as much as possible with matlab.

Kai




More information about the Help-octave mailing list