[GEM-dev] frambuffer does change the scene perspective

cyrille henry cyrille.henry at la-kitchen.fr
Sun May 25 16:09:42 CEST 2008



marius schebella a écrit :
> cyrille henry wrote:
>> here is a patch that explain this problem.
> 
> hi cyrille,
> 
> I think you are right, gemframebuffer should not affect the main window. 
> Not sure why nobody noticed that before...
> but besides from that, I am not sure, how gemframebuffer should behave, 
> if it should adjust to the world perspec or not. since framebuffer is 
> ignoring the view, maybe it should also ignore the perspec? (and accept 
> individual frustum message instead, and individual view?).
for now, gemframbuffer does ignore view, perspective,color etc of the gemwin. 
The fix i submit did not change that. it just restore the perspective to it's correct value after drawing in the FB.
i think the gemframbuffer should be albe to accept a perspec and view message, just like gemwin does. but that's something else.

cyrille

> 
> I posted a question about ortho some days ago, and would like to know if 
> this is related? (when using ortho in non square windows everything is 
> distorted, too).
> 
> marius.
> 
>>
>> 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 at iem.at
>>> http://lists.puredata.info/listinfo/gem-dev
>>>
>>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> GEM-dev mailing list
>> GEM-dev at iem.at
>> http://lists.puredata.info/listinfo/gem-dev
> 
> 
> 




More information about the GEM-dev mailing list