[gl2ps] GL2PS_POLYGON_OFFSET_FILL usage

Pantxo Diribarne pantxo.diribarne at gmail.com
Fri Mar 20 21:02:56 CET 2015


Hi,

I attached a patch that fixes the issue of only having access to the last
set values for polygon_offset. The changes are as follows:
* I replaced the "offset" field of the gl2ps structure with 2 fields
(ounits and ofactor) in the GL2PSprimitive structure,
* I used the same scheme as GL2PS_LINE_STIPPLE to store the values of the
offset factor and units in the feedback buffer,
* I added an example of the usage in gl2psTestSimple.c.

Hope this helps,

Pantxo




2015-02-15 11:25 GMT+01:00 Pantxo Diribarne <pantxo.diribarne at gmail.com>:

> Hi,
>
> Thanks for your answer. I am no OpenGl expert (my initial interest was to
> solve a bug in Octave [1]) but I'll try to provide a patch. I may be a bit
> to optimistic but I am under the impression that it's just a matter of
> copying the way line stipple stores values in the feedback buffer.
>
> Pantxo
>
> [1] http://savannah.gnu.org/bugs/?44111
>
> 2015-02-13 16:24 GMT+01:00 Christophe Geuzaine <cgeuzaine at ulg.ac.be>:
>
>>
>> > On 09 Feb 2015, at 11:37, Pantxo Diribarne <pantxo.diribarne at gmail.com>
>> wrote:
>> >
>> > Hi,
>> >
>> > I am currently trying to figure out how to use gl2psEnable/Disable with
>> GL2PS_POLYGON_OFFSET_FILL flag. From the example using GL2PS_LINE_STIPPLE
>> (in gl2psTest.c) I understand that I should Enable/Disable
>> GL2PS_POLYGON_OFFSET_FILL each time I change the offset in my opengl scene.
>> Am I correct?
>> >
>> > If so, my concern is that reading gl2ps.c I am under the impression
>> that only the last offset values of my scene will be taken into     account
>> when finally parsing the feedback buffer. The "offset" field in the
>> gl2pscontext is overwritten each time gl2psEnable is called. What do I miss?
>>
>> Indeed, currently gl2psEnable(GL2PS_POLYGON_OFFSET_FILL) acts like an
>> "on/off" switch for polygon offset; the actual values of the offset are
>> fixed by the ones at the time of the last call...
>>
>> Don't hesitate to send a patch if you decide to fix this.
>>
>> Christophe
>>
>> >
>> > Thanks for your work,
>> >
>> > Pantxo
>> > _______________________________________________
>> > gl2ps mailing list
>> > gl2ps at geuz.org
>> > http://www.geuz.org/mailman/listinfo/gl2ps
>>
>> --
>> Prof. Christophe Geuzaine
>> University of Liege, Electrical Engineering and Computer Science
>> http://www.montefiore.ulg.ac.be/~geuzaine
>>
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gl2ps/attachments/20150320/5b484095/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_polygonoffset.patch
Type: text/x-diff
Size: 8478 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gl2ps/attachments/20150320/5b484095/attachment.patch>