here is a patch that explain this problem.
cyrille
cyrille henry a écrit :
hello, when using a framebuffer in a patch, the perspective of the main windows is change to (-1, 1) in X and Y. So it's no more possible to use custom perspective (sending the perspec message to gemwin is useless). moreover, the perspective used lead to distorted images when the gemwin is not square.
fixing this is quite easy, but will break all patch using frambuffer with a not square gem windows. so, i'm wondering if i should commit the fix.
the fix is mainly to replace line 145 of gemframebuffer.cpp :
glFrustum(-1,1,-1,1,1,25);
with :
float xDivy = (float)GemMan::m_w / (float)GemMan::m_h;
glFrustum(GemMan::m_perspect[0] * xDivy, GemMan::m_perspect[1] * xDivy, // left, right GemMan::m_perspect[2], GemMan::m_perspect[3], // bottom, top GemMan::m_perspect[4], GemMan::m_perspect[5]); // front, back
but it need to add #include "Base/GemMan.h"
and to move static int m_w; static int m_h; from private to public in GemMan.h
should i commit this?
cyrille
GEM-dev mailing list GEM-dev@iem.at http://lists.puredata.info/listinfo/gem-dev
#N canvas 282 295 603 298 10; #X msg 28 38 0 , destroy; #X obj 18 119 gemhead; #X obj 18 148 square 1; #X msg 18 15 reset , dimen 600 100 , create , 1; #X obj 18 172 gemhead 1; #X obj 18 249 gemframebuffer; #X obj 18 94 gemwin; #X obj 18 227 spigot 0; #X obj 63 205 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X msg 60 67 perspec -1 10 -1 1 1 20; #X text 227 16 <- 1; #X text 86 205 <- 2 : using frambuffer does change persective; #X text 228 67 <- 3 : custom perspective are usless with a frambuffer ; #X connect 0 0 6 0; #X connect 1 0 2 0; #X connect 3 0 6 0; #X connect 4 0 7 0; #X connect 7 0 5 0; #X connect 8 0 7 1; #X connect 9 0 6 0;