You are wondering why a 1:1 perspective works for a 4:3 window? <br><br><div><span class="gmail_quote">On 5/13/07, <b class="gmail_sendername">cyrille henry</b> <<a href="mailto:cyrille.henry@la-kitchen.fr">cyrille.henry@la-kitchen.fr
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">could you also try the test3 patch i just send?<br><br>thanks<br>Cyrille
<br><br><br>chris clepper a écrit :<br>> Your example patch works exactly as it should on OSX.<br>><br>> On 5/13/07, altern <<a href="mailto:altern2@gmail.com">altern2@gmail.com</a>> wrote:<br>>><br>>> cyrille henry(e)k dio:
<br>>> > hello,<br>>> ><br>>> > altern a écrit :<br>>> >> hi<br>>> >><br>>> >> do you mean something like the example attached?<br>>> > yes, exactly.
<br>>> ><br>>> >> This doesnt work ok for me, the shape should be 10x10 px and is not,<br>>> > a [rectangle 10 10] should be 20 pixel.<br>>><br>>> i understand from the rectangle help that [rectangle 10 10] should be a
<br>>> 10 units width by 10 units height square. I get a rectangle which is<br>>> irregular, check the attached screnshot gif<br>>><br>>> >> also x and y pos are dont match with window size. Translating to 400,
<br>>> >> 300 should place the rect in top right corner but I get that with only<br>>> >> 320, 190, so the units are not mapped to pixels<br>>> > translating to 400 300 should move the center of the rectangle in the
<br>>> > top right corner.<br>>> > if your rectangle is 100 100, then you just have to move it 300 200 in<br>>> > order to have the corner of the rectangle in the corner of the gem<br>>> window.
<br>>> ><br>>> > your patch work that way here.<br>>><br>>> check the attachment again, the rect is 10x10 and it is located at<br>>> X=307, Y=167. This should be far from 400, 300 which should be the
<br>>> top,right location. So the coordinate system is distorted, specially on<br>>> the y axis<br>>><br>>> I also tried with<br>>> dimen 400 400<br>>> perspec 0 400 0 400 999 1001<br>>> If draw a 1 by 1 rect and i get it to the right top corner by
<br>>> translating it 320, 320. So pixels are dont match gl units and moreover<br>>> in the previous example when the gem window is not a square the<br>>> distortion affects differently the X and the Y axis
<br>>><br>>> >><br>>> >> but maybe i am missing something from what you describe?<br>>> >><br>>> >> In opengl to achieve this 2D like-pixels to units effect i would<br>
>> >> set the perspective to be orthographical with glOrtho command, is<br>>> >> something like this possible in Gem?<br>>> > yes, insert an [ortho] after the gemhead<br>>> ><br>>> >
<br>>> > cyrille<br>>> ><br>>> >><br>>> >> thanks!!<br>>> >><br>>> >> enrike<br>>> >><br>>> >> cyrille henry(e)k dio:<br>>> >>> hello,
<br>>> >>><br>>> >>> i tried with :<br>>> >>> dimen 400 300<br>>> >>> view 0 0 1000 // 1000 is in order to put the camera far from the view<br>>> >>> point, to reduce space distortion
<br>>> >>> perspec 0 400 0 300 999 1001 // 999 and 1001 limit the render to<br>>> >>> primitive position is between -1 and 1 (because camera is at 1000)<br>>> >>><br>>> >>>
<br>>> >>> and everything is working as expected.<br>>> >>> i just have 1 strange thing : i need to set the [dimen<, [create< ,<br>>> >>> then [reset< and last [view< and [perspec< if i did not do a reset, a
<br>>> >>> square is not rendered as a square but a rectangle.<br>>> >>><br>>> >>> anyway, it's working.<br>>> >>><br>>> >>> cyrille<br>>> >>>
<br>>> >>><br>>> >>> altern a écrit :<br>>> >>>> i tried to pass different view values to gemwin. I can see that in<br>>> >>>> order to be able to specify location or with with pixels i should
<br>>> >>>> set view to<br>>> >>>> view 0 0 2<br>>> >>>> but as soon as i set that the shape is not there any more. This is<br>>> >>>> an example i am using to test. If i ser view to
<br>>> >>>> view 0 0 2.01<br>>> >>>> it is almost there but if i set it to 0 0 2 it is not there any<br>>> >>>> more. I guess it might be because it is either beyond the back limit
<br>>> >>>> y or behind the camera?<br>>> >>>><br>>> >>>> thanks<br>>> >>>><br>>> >>>> enrike<br>>> >>>><br>>> >>>>
<br>>> >>>> altern(e)k dio:<br>>> >>>>> hi<br>>> >>>>><br>>> >>>>> I am trying to map GEM units to pixels so that i can position some<br>>> >>>>> videos in the GEM window using pixels values. For this I understand
<br>>> >>>>> that<br>>> >>>>> i must match the projection values with the window size. So i am<br>>> doing<br>>> >>>>><br>>> >>>>> dimen 400 300
<br>>> >>>>> perspect 0 400 0 300 1 20<br>>> >>>>><br>>> >>>>> and i render all objects at z position 1<br>>> >>>>><br>>> >>>>> translateXYZ 100 100 1
<br>>> >>>>><br>>> >>>>> However I am getting a weird result, the units are far smaller that<br>>> >>>>> pixels, so to move a video 100px in the x i need to change it x
<br>>> >>>>> position<br>>> >>>>> by 300 units or something like this. So I am not sure about what i<br>>> am<br>>> >>>>> doing wrong, I am familiar with OpenGL but i never played too much
<br>>> >>>>> with<br>>> >>>>> GEM before so I am still getting into it.<br>>> >>>>><br>>> >>>>> Another small issue is that I would also like to reverse the Y so
<br>>> that<br>>> >>>>> upper left is 0,0 and bottom left would be 0,200 for example, not<br>>> sure<br>>> >>>>> about how to change this. I guess it is to do with the gemwin
<br>>> settings<br>>> >>>>> but i dont get it right.<br>>> >>>>><br>>> >>>>> thanks<br>>> >>>>><br>>> >>>>> enrike
<br>>> >>>>><br>>> >>>>><br>>> >>>><br>>> >>>><br>>> >>>> _______________________________________________<br>>> >>>>
<a href="mailto:PD-list@iem.at">PD-list@iem.at</a> mailing list<br>>> >>>> UNSUBSCRIBE and account-management -><br>>> >>>> <a href="http://lists.puredata.info/listinfo/pd-list">http://lists.puredata.info/listinfo/pd-list
</a><br>>> >>>><br>>> >>>><br>>> >>><br>>> >><br>>> >><br>>> >><br>>> >><br>>> ------------------------------------------------------------------------
<br>>> >><br>>> >> #N canvas 393 156 429 320 10;<br>>> >> #X obj 84 210 gemwin;<br>>> >> #X obj 245 163 gemhead;<br>>> >> #X msg 173 82 create \, 1;<br>>> >> #X msg 293 106 0 \, destroy;
<br>>> >> #X floatatom 309 164 5 0 0 0 - - -;<br>>> >> #X floatatom 347 164 5 0 0 0 - - -;<br>>> >> #X floatatom 288 215 5 0 0 0 - - -;<br>>> >> #X floatatom 332 215 5 0 0 0 - - -;
<br>>> >> #X obj 245 190 translateXYZ 10 10 1;<br>>> >> #X msg 215 50 dimen 400 300;<br>>> >> #X msg 48 73 view 0 0 1000;<br>>> >> #X msg 9 48 perspec 0 400 0 300 999 1001;<br>
>> >> #X msg 110 99 reset;<br>>> >> #X obj 50 -8 bng 15 250 50 0 empty empty empty 0 -6 0 10 -262144 -1<br>>> >> -1;<br>>> >> #X obj 50 13 t b b b b b;<br>>> >> #X obj 245 234 rectangle 10 10;
<br>>> >> #X connect 1 0 8 0;<br>>> >> #X connect 2 0 0 0;<br>>> >> #X connect 3 0 0 0;<br>>> >> #X connect 4 0 8 1;<br>>> >> #X connect 5 0 8 2;<br>>> >> #X connect 6 0 15 1;
<br>>> >> #X connect 7 0 15 2;<br>>> >> #X connect 8 0 15 0;<br>>> >> #X connect 9 0 0 0;<br>>> >> #X connect 10 0 0 0;<br>>> >> #X connect 11 0 0 0;<br>>> >> #X connect 12 0 0 0;
<br>>> >> #X connect 13 0 14 0;<br>>> >> #X connect 14 0 11 0;<br>>> >> #X connect 14 1 10 0;<br>>> >> #X connect 14 2 12 0;<br>>> >> #X connect 14 3 2 0;<br>>> >> #X connect 14 4 9 0;
<br>>> >><br>>> ><br>>><br>>><br>>> _______________________________________________<br>>> <a href="mailto:PD-list@iem.at">PD-list@iem.at</a> mailing list<br>>> UNSUBSCRIBE and account-management ->
<br>>> <a href="http://lists.puredata.info/listinfo/pd-list">http://lists.puredata.info/listinfo/pd-list</a><br>>><br>>><br>>><br>><br></blockquote></div><br>