[PD] GEM mapping units to pixels

cyrille henry cyrille.henry at la-kitchen.fr
Fri May 11 16:19:48 CEST 2007


hello,

i think you should also move the camera position.

if you use this : 
> dimen 400 300
> perspect 0 400 0 300 1 20
then you should also use somthing like this : 
view 200 150 1000

moving the camera far from the point you look at should reduce distortion.

cyrille

altern a écrit :
> 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