On Tue, 2011-09-13 at 15:35 +0200, Kevin DeMott wrote: > So I'm pretty close to getting this working using the osghud example code. > > The problem I'm having now is that color grid on the left side of the screen > is not visible at the start of the application. I traced this problem down to > the fact that during creation the window size is larger than what the initial > displayed window size is. So if I manually make the window larger then the > color grid is visible. > > I fixed this problem by adding my own ResizedCallback to the GraphicsContext > the hud camera is using. The ResizedCallback then updates the > ProjectionMatrix to the dimensions of the new window size. This seems to work > fine for anything that is aligned with the left side of the screen. I'm now > working on adding another object to the hud in the upper right hand corner of > the screen. > > To do this I create the my object and then apply a PositionAttitudeTransform > matrix to the root node of my new object. The positional vector is based on: > x = width of window minus width of new object, y = height of window minus > height of new object. > > The result is that initially the object is not viewable until I manually > resize the window with the mouse to make the viewing area larger. I'm > thinking that I'm running into pretty much the same problem I had before I > added the ResizedCallback, which is that the window size at creation time is > larger than that at display time. So I'm basically placing the image beyond > the viewable area initially. > > It seems I could solve this problem by updating the PositionAttitudeTransform > matrix in my ResizedCallback to take into account the new window width and > height. However, that seems like it is going to get really tedious as more > and more things are added to the hud and is not the correct approach I should > be using. > > Can anyone recommend any alternative approaches to this problem?
Is the source to this application available? > Thanks > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=42692#42692 > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

