[PD] Drawing a sine function dynamically in Gem

Cyrille Henry ch at chnry.net
Wed Apr 10 22:28:42 CEST 2013


hello,

you just have to put the gemhead in the gemlist befor the glBegin.
see attachement.

cheers
c


Le 10/04/2013 22:11, Roman Haefeli a écrit :
> On Mit, 2013-04-03 at 11:59 +0200, Cyrille Henry wrote:
>> hello,
>>
>> you have lot's of solution to draw a sinus curve in Gem.
>
> [...]
>
>> you can also do like in openGL : using GEMglBegin, GEMglVextex (many
>> of them thanks to an iterative loop), and GEMglEnd
>
> I'm interested in understanding that approach. So far I was able to draw
> a simple line:
>
> [gemhead]
> |
> [GEMglBegin GL_LINES]
> |
> [GEMglVertex2d -2 -2]
> |
> [GEMglVertex2d 2 2]
> |
> [GEMglEnd]
>
> But how are you creating an iterative loop out of this? I tried after
> GEMglBegin:
>
> [t a b a]
> |    |   \
> |    [20( \
> |    |     \
> |    [until]\
> |    |       \
> |    [gemlist ]
> |    |          <- put the two [GEMglVertex2d] here.
> |
> [GEMglEnd]
>
> However, this causes an error on every frame:
> GL: invalid operation
>
> What is the correct way to do this?
>
> Roman
>
>
>
>> Le 02/04/2013 23:18, Alexandros Drymonitis a écrit :
>>> I want to build this visual http://processing.org/learning/trig/ in Pd, but I want the sine curve to be drawn dynamically with every circle spin. It seems quite hard though.
>>>
>>> I don't know which object would be best. I tried either [curve] but the parameters are way too many and I'm not sure if precision is really possible. Then I tried [square 0.008] in combination with [repeat] but also doesn't work.
>>> Anyone knows how to do this?
>>>
>>>
>>> _______________________________________________
>>> Pd-list at iem.at mailing list
>>> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>>>
>>
>> _______________________________________________
>> Pd-list at iem.at mailing list
>> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>
>
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gl_lines.pd
Type: application/puredata
Size: 913 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20130410/3df93a47/attachment.bin>


More information about the Pd-list mailing list