[PD] GEM mapping units to pixels

cyrille henry cyrille.henry at la-kitchen.fr
Sat May 12 11:54:32 CEST 2007


hello,

i tried with : 

dimen 400 300
view 0 0 1000 // 1000 is in order to put the camera far from the view point, to reduce space distortion
perspec 0 400 0 300 999 1001 // 999 and 1001 limit the render to primitive position is between -1 and 1 (because camera is at 1000)


and everything is working as expected.
i just have 1 strange thing : 
i need to set the [dimen<, [create<  , then [reset< and last [view< and [perspec< 
if i did not do a reset, a square is not rendered as a square but a rectangle.

anyway, it's working.

cyrille


altern a écrit :
> i tried to pass different view values to gemwin. I can see that in order 
> to be able to specify location or with with pixels i should set view to
> view 0 0 2
> but as soon as i set that the shape is not there any more. This is an 
> example i am using to test. If i ser view to
> view 0 0 2.01
> it is almost there but if i set it to 0 0 2 it is not there any more. I 
> guess it might be because it is either beyond the back limit y or behind 
> the camera?
> 
> thanks
> 
> enrike
> 
> 
> altern(e)k dio:
>> hi
>>
>> I am trying to map GEM units to pixels so that i can position some
>> videos in the GEM window using pixels values. For this I understand that
>> i must match the projection values with the window size. So i am doing
>>
>> dimen 400 300
>> perspect 0 400 0 300 1 20
>>
>> and i render all objects at z position 1
>>
>> translateXYZ 100 100 1
>>
>> However I am getting a weird result, the units are far smaller that
>> pixels, so to move a video 100px in the x i need to change it x position
>> by 300 units or something like this. So I am not sure about what i am
>> doing wrong, I am familiar with OpenGL but i never played too much with
>> GEM before so I am still getting into it.
>>
>> Another small issue is that I would also like to reverse the Y so that
>> upper left is 0,0 and bottom left would be 0,200 for example, not sure
>> about how to change this. I guess it is to do with the gemwin settings
>> but i dont get it right.
>>
>> thanks
>>
>> enrike
>>
>>
> 
> 
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
> 
> 




More information about the Pd-list mailing list