Hi carsten Thanks to your hint on probing the viewport's left and right pixels I was able to track down the problem:
I was specifying the dummy width of the MultiDisplayWindow without considering the number of servers connected. My code was beginEditCP(m_pWin); m_pWin->setSize(m_iServerWidth, m_iServerHeight); endEditCP(m_pWin); instead of beginEditCP(m_pWin); m_pWin->setSize(m_iServerWidth * nServers, m_iServerHeight); endEditCP(m_pWin); so I think it was no surprise to have some pixel mismatchs. Now all the viewports are behaving correctly... Thanks again, Enrico -----Messaggio originale----- Da: Carsten Neumann [mailto:carsten_neum...@gmx.net] Inviato: giovedì 11 dicembre 2008 23.40 A: opensg-users@lists.sourceforge.net Oggetto: Re: [Opensg-users] cluster-server viewport size Hi Enrico, Enrico Borrione wrote: > Hi openSG users, > using my cave application I run into a small, yet unpleasant, problem. > > I have 3 servers, which use 3 separate viewports. > I create the viewports passing them the size, so they occupy one third of > the multi display window each: > > beginEditCP(mainShVprt); > { > ...stuff... > mainShVprt->setSize(left,0.0,right,1.0); > ...stuff... > } > endEditCP(mainShVprt); > > Where left and right for the three viewports are: > > Left Right > Server 0 0.0 1/NServers > Server 1 1/NServers 1/NServers * 2 > Server 2 1/NServers * 2 1.0 this is probably something like 1.0f/NServers, so that you get floating point division ? > The servers work correctly, except that the first and the last column of > pixels of every Server Window > display just a dirty buffer. > > Am I doing something wrong? no, this is how things should work, i.e. you should get viewports that are right next to each other. However in Viewport::getPixelLeft()/getPixelRight() the values are computed like this: return Int32(getParent()->getWidth() * getLeft()); return Int32(getParent()->getWidth() * getRight() - 1); so I'm wondering if this is a rounding problem, i.e. if the product above produces something 240.999 and the conversion to Int32 just chops off the .999 part, essentially giving you a 1 off error ? What is the width/height of the window you are using ? What values do you get from Viewport::getPixelLeft()/getPixelRight() for each viewport? regards, Carsten ---------------------------------------------------------------------------- -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users