Re: [osg-users] Color grid overlay question/help

2011-09-13 Thread Kevin DeMott
No, as it is pretty heavily tied into other source that can not be made 
available. I can probably post the code for how the HUD and the object to be 
placed in the upper right hand corner are being created if that would help 
though. IE the posted code would not run on its own.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=42703#42703





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Color grid overlay question/help

2011-09-13 Thread Jeremy Moles
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
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Color grid overlay question/help

2011-09-13 Thread Kevin DeMott
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? 

Thanks

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=42692#42692





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Color grid overlay question/help

2011-08-31 Thread Paul Martz

On 8/31/2011 8:48 AM, Kevin DeMott wrote:

There is no reason I have to use osgWidget. I'm rather new to using osg and it 
seemed to fit into the scheme of everything else that was going on. Is there 
perhaps a basic example you can point me to regarding the implementation you 
suggested?


I don't think there is an example that does exactly what you want, but there is 
osghud as an example of 2D rendering, if that's what you need help with? 
Certainly all the osgWidget code is at your disposal as well, so if it *almost* 
does what you want, you could copy it and modify it...

   -Paul

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Color grid overlay question/help

2011-08-31 Thread Kevin DeMott
There is no reason I have to use osgWidget. I'm rather new to using osg and it 
seemed to fit into the scheme of everything else that was going on. Is there 
perhaps a basic example you can point me to regarding the implementation you 
suggested?

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=42331#42331





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Color grid overlay question/help

2011-08-31 Thread Paul Martz

On 8/31/2011 8:02 AM, Kevin DeMott wrote:

I'm trying to create a 4x1 (row x col) grid on top of my scene. The rows should 
equally fill up the height of the window while the column width should be 1/4 
the width of the window. The intent is to have the user be able to specify a 
color for each cell. Not all cells may be specified at a given time. Cells with 
a specified color should be on top of the scene. IE the scene is not visible in 
those locations.

I have tried to create this using an osgWidget::Table. However, it appears you 
have to create widgets for all the cells in order to ensure that cell ends up 
in the correction location in the grid overlay. Is there perhaps a way to 
specify a widget that is transparent in order for the scene to be shown?

I also tried to use an osgWidget::Canvas. This allowed me to place widgets in 
the correct cells. However, if had cell 1 and cell 3 defined with separate 
colors then cell 2 would be colored white even though there was no widget 
defined there. I'm assuming this is a property of the window/window manager. 
However, I can't seem to figure out how to make this transparent either.

Any help or ideas on how to achieve this would be greatly appreciated.
Is there a reason why you have to use osgWidget for this? It sounds like it is 
the source of your problems, as it was probably not designed for your usage.


It should be pretty straightforward to use a Camera configured for 2D rendering 
(post render, clear z buffer only, etc).

   -Paul

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Color grid overlay question/help

2011-08-31 Thread Kevin DeMott
I'm trying to create a 4x1 (row x col) grid on top of my scene. The rows should 
equally fill up the height of the window while the column width should be 1/4 
the width of the window. The intent is to have the user be able to specify a 
color for each cell. Not all cells may be specified at a given time. Cells with 
a specified color should be on top of the scene. IE the scene is not visible in 
those locations.

I have tried to create this using an osgWidget::Table. However, it appears you 
have to create widgets for all the cells in order to ensure that cell ends up 
in the correction location in the grid overlay. Is there perhaps a way to 
specify a widget that is transparent in order for the scene to be shown?

I also tried to use an osgWidget::Canvas. This allowed me to place widgets in 
the correct cells. However, if had cell 1 and cell 3 defined with separate 
colors then cell 2 would be colored white even though there was no widget 
defined there. I'm assuming this is a property of the window/window manager. 
However, I can't seem to figure out how to make this transparent either.

Any help or ideas on how to achieve this would be greatly appreciated.

Thanks

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=42327#42327





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org