Re: [osg-users] embedding osg::viewer

2019-08-31 Thread Noè Murr
Little update to the previous post:

I have read the implementation of 
osgviewer::Viewer::setUpViewerAsEmbeddedInWidnow() method and this is the code:


Code:

GraphicsWindowEmbedded* Viewer::setUpViewerAsEmbeddedInWindow(int x, int y, int 
width, int height)
{
setThreadingModel(SingleThreaded);
osgViewer::GraphicsWindowEmbedded* gw = new 
osgViewer::GraphicsWindowEmbedded(x,y,width,height);
getCamera()->setViewport(new osg::Viewport(0,0,width,height));
getCamera()->setProjectionMatrixAsPerspective(30.0f, 
static_cast(width)/static_cast(height), 1.0f, 1.0f);
getCamera()->setGraphicsContext(gw);
return gw;
}




I think that the viewport of the camera should be changed to: 
getCamera()->setViewport(new osg::Viewport(x,y,width,height));

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





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


Re: [osg-users] embedding osg::viewer

2019-08-31 Thread Noè Murr
Hi,

I'm answering my own question:

To move the area where my scene is drawn I have to set 
the viewport of the camera. 

So if I add this line to the configuration of osgviewerSDL example I can change 
the position of the scene in the window:


Code:


viewer.getCamera()->setViewport(myX, myY, myWidth, myHeight);





Now I've got two more sneaky problems.

First I can't understand what are the responsibility of this method:
osgViewer::GraphicsContext::resized;

The documentation says:
resized implementation, by default resizes the viewports and aspect ratios the 
cameras associated with the graphics Window. 

It effectively does resize the viewport but it does not move it? so why am I 
passing it an X and Y?

Second problem:

If I create a osgviewer::GraphicsEmbeddedWidnow 800x600 and I set a viewport, 
for the camera of the viewer, of 800x800. The viewer.frame() method draws on an 
area of 800x800 that is greater than the area of the embedded window...

So what's the meaning of giving the x, y, width and height value to the window?

Cheers,
Noè[/list]

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





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


[osg-users] embedding osg::viewer

2019-08-27 Thread Noè Murr
Hi,

I've already asked this question on the mailing list, but it was a secondary 
question and perhaps nobody read it. 

I'm trying to embed osg in a SFML view using the setUpViewerAsEmbeddedInWindow 
method of the viewer.

The problem is that I cannot change the position where the viewer is displayed. 
OSG ignores the value that I give as first and second argument of the method 
and draws the frame always starting from the bottom left corner of the window.

I tried to change the value of the first and second argument even in the 
osgviewerSDL example because it use the same method to embed OSG, but even in 
this example the viewer always starts to draw the frame in the bottom left 
corner.

I'm going to attach the code of the example that I have changed on the lines: 
58 132 158 168

Do you know what's the problem?

Thank you!

Cheers,
Noè Murr

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




Attachments: 
http://forum.openscenegraph.org//files/osgviewersdl_203.cpp


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


Re: [osg-users] embedding OSG into SFML window

2019-08-25 Thread Noè Murr
Hi all,

I have found the mistake! It was a very very stupid mistake: I forgot a 
return after the handling of the text entered event.

Now I have another problem: If I change the value of x and y of the 
function setUpViewerAsEmbeddedInWindow() nothing changes.

How can I draw the the frame in a specific position inside my window?

Cheers,
 Noè Murr

On 24/08/19 18:36, Noè Murr wrote:
> Hi all,
> 
> I'm trying to mbed an osgviewer into an SFML window.
> 
> Stating from this code
> https://gist.github.com/colesnicov/bca684b939d19e2d1ac74d9a881b35b1,
> I've written my own version that does not use the sfgui library.
> 
> You can see the code as attachment of this message.
> 
> The problem is that when I pres the 'S' key to start the stats handler I
> get a bunch of OpenGL error and I get very strange visual results, as
> you can see in the video attached.
> 
> If I resize the window the error is solved until the next event.
> 
> Do you know why I got this errors and how can I avoid them?
> 
> Cheers,
>   Noè Murr
> 
> 
> ___
> 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] Gui widgets that expands on more views

2019-08-17 Thread Noè Murr
Hi Robert,

Thank you for the answer. I like this method:

"One way is to create a Camera (with otho projection) and subgraph to 
render the widgets and assign this Camera to the GraphicsWindow and set 
the Camera's RenderOrder so it get drawn last."

As I have only to draw 2D widgets, can I create a fake camera that does 
not need the scene graph interface where I can draw directly in openGL?

If I can, how should I do that?

Cheers,
 Noè

On 17/08/19 15:36, Robert Osfield wrote:
> HI Noè,
> 
> You can do an overall like this several ways.  One way is to create a 
> Camera (with otho projection) and subgraph to render the widgets and 
> assign this Camera to the GraphicsWindow and set the Camera's 
> RenderOrder so it get drawn last.  Another way is create another View 
> and then have this Camera below that.
> 
> I think the osgsequence and osgtesselate examples illustrates this type 
> of usage case. Do a search for Camera in the examples should illuminate 
> other ways Camera's are used.
> 
> To toggle on/off the widget overall simply set the Camera's NodeMask to 
> 0x0 for switching it off, and back to 0x (or any non zero should 
> also do) to switch it back on again.
> 
> Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Gui widgets that expands on more views

2019-08-17 Thread Noè Murr
Hi,

I'm trying to resolve a complicated task.

I have a Graph that will be rendered by 4 cameras in 4 different views
using a composite viewer (see the first attachment).

I want to render a 2D element that expands on all the views as you can 
see in
the second attachment.

Is there a way to do that in OpenSceneGraph?

Cheers,
 Noè Murr
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgUI and osgWidgets

2019-08-13 Thread Noè Murr
Hi,

I need to integrate a user interface inside my OSG program.

I want to use the osgUI library but I cannot find a good tutorial or guide 
about that? 
Can someone recommend me a good starting point? 

Thank you!

Cheers,
Noè

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





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


[osg-users] [3rdparty] ImGui integration again

2019-08-08 Thread Noè Murr
Hi all,

I would like to use dear ImGUI with openscenegraph.
I see that the argument is already been discussed on this mailing list 
in 2017 
(https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg75576.html).
Is there any news about that?
Is there a usable library that does the interaction or that would be a 
good starting point for my own library?

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


[osg-users] osg::Drawable vs osg::Geometry

2018-10-21 Thread Noè Murr
Hi,

I need to draw a custom object in osg. 

To do that I have to choose between derive from class osg::Drawable and 
deriving from osg::Geometry. 

Which is the more efficient way to create a custom drawable object and why? 

Thank you!

p.s. I'm new to osg, so I'm trying to understand the best practices.

Cheers,
Noè

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





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


Re: [osg-users] OpenSceneGraph 3.0 for beginners book Quality

2018-10-14 Thread Noè Murr
Hi,

Thanks for all your advices! I will read the book like a good introduction, but 
of course I will use the examples to understand the correct usage of OSG.

Thank you again!

Cheers,
Noè

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





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


[osg-users] OpenSceneGraph 3.0 for beginners book Quality

2018-10-12 Thread Noè Murr
Hi all,

I want to learn how to use OSG. I'm new, I know the basics of OpenGL and I've 
studied Computer Graphics at the university. 
I found the book [b]OpenSceneGraph 3.0 for beginners[\b] but I noticed that it 
has been published in 2010, so it's very old... Is it still a good starting 
point? is there something more updated? 

Thank you!

Cheers,
Noè

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





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