OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Intergration with QT


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
aozdin
Newbie


Joined: 28 Feb 2018
Posts: 16

PostPosted: Tue Mar 13, 2018 2:13 pm    Post subject:
Intergration with QT
Reply with quote

Hi,

I am using QT 5.4.1 and osg 3.4.1. I am drawing a line and moving this line to the right of the screen dynamically. This code was working before integrating with Qt.

With Qt, the line moves to the right of the screen; but lines in the old position is not removed from the screen. I have shared the screen captures related to this situation and source code in the attachment.

Best regards,
Back to top
View user's profile Send private message
aozdin
Newbie


Joined: 28 Feb 2018
Posts: 16

PostPosted: Wed Mar 14, 2018 7:50 am    Post subject:
Reply with quote

I think my problem is osg writes each frame on the previous frame without removing the objects on the previous frame.
How can I solve this? Any idea?
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12094

PostPosted: Wed Mar 14, 2018 9:37 am    Post subject:
Intergration with QT
Reply with quote

Hi Ali,

On 14 March 2018 at 07:50, Ali Ozdin <> wrote:
Quote:
I think my problem is osg writes each frame on the previous frame without removing the objects on the previous frame.
How can I solve this? Any idea?

I'm not a Qt expert, but I have just had a look through your code
example and don't see anywhere you have set up a the View's main
Camera. I looks like you just add a Slave camara, and that slave
Camera only clears the depth buffer.

I don't understand why you have gone for the set up you have, if you
just need a single orthographic view then you should just set up the
View's master Camera's projection and view matrix accordingly and not
both with the addSlave.

If you intend to have a 3D view that is overlay by the Orthographic
view as a HUD, and the two are directly related then a slave Camera
might be appropriate. Ask yourself, conceptually is the HUD a
different View, or is it contributing to the same View.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
aozdin
Newbie


Joined: 28 Feb 2018
Posts: 16

PostPosted: Wed Mar 14, 2018 10:27 am    Post subject:
Re: Intergration with QT
Reply with quote

Hi Robert,

Firstly, I am grateful for your quick reply.

I intend to have a 3D view that is overlay by the Orthographic view as a HUD. That is right. So i am trying to derive hud example. Because of this, i have added the hud camera as a slave.
You say that slave cameras only clear the depth buffer and I think problem is that.
The only thing i did not understand you say that i did not set up the main camera. I am asking to you "How to set up the main camera?" In osgviewerQt example, Nothing is done to viewer's default camera except setting graphic context to default camera. I have already set the graphical context to the default camera in addition to setting it to the slave camera. But nothing changed.
On the other hand the same code works well if i dont integrate it to QT. There is no problem related to the depth buffer or any other thing.

Finally, The problem is still unresolved. Any other idea??

Best regards,

robertosfield wrote:
Hi Ali,

I'm not a Qt expert, but I have just had a look through your code
example and don't see anywhere you have set up a the View's main
Camera. I looks like you just add a Slave camara, and that slave
Camera only clears the depth buffer.

I don't understand why you have gone for the set up you have, if you
just need a single orthographic view then you should just set up the
View's master Camera's projection and view matrix accordingly and not
both with the addSlave.

If you intend to have a 3D view that is overlay by the Orthographic
view as a HUD, and the two are directly related then a slave Camera
might be appropriate. Ask yourself, conceptually is the HUD a
different View, or is it contributing to the same View.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
aozdin
Newbie


Joined: 28 Feb 2018
Posts: 16

PostPosted: Fri Mar 16, 2018 10:18 am    Post subject:
Re: Intergration with QT
Reply with quote

I have set clear mask for hud camera GL_COLOR_BUFFER_BIT in addition to GL_DEPTH_BUFFER_BIT. The problem was solved.


aozdin wrote:
Hi Robert,

Firstly, I am grateful for your quick reply.

I intend to have a 3D view that is overlay by the Orthographic view as a HUD. That is right. So i am trying to derive hud example. Because of this, i have added the hud camera as a slave.
You say that slave cameras only clear the depth buffer and I think problem is that.
The only thing i did not understand you say that i did not set up the main camera. I am asking to you "How to set up the main camera?" In osgviewerQt example, Nothing is done to viewer's default camera except setting graphic context to default camera. I have already set the graphical context to the default camera in addition to setting it to the slave camera. But nothing changed.
On the other hand the same code works well if i dont integrate it to QT. There is no problem related to the depth buffer or any other thing.

Finally, The problem is still unresolved. Any other idea??

Best regards,

robertosfield wrote:
Hi Ali,

I'm not a Qt expert, but I have just had a look through your code
example and don't see anywhere you have set up a the View's main
Camera. I looks like you just add a Slave camara, and that slave
Camera only clears the depth buffer.

I don't understand why you have gone for the set up you have, if you
just need a single orthographic view then you should just set up the
View's master Camera's projection and view matrix accordingly and not
both with the addSlave.

If you intend to have a 3D view that is overlay by the Orthographic
view as a HUD, and the two are directly related then a slave Camera
might be appropriate. Ask yourself, conceptually is the HUD a
different View, or is it contributing to the same View.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12094

PostPosted: Fri Mar 16, 2018 12:07 pm    Post subject:
Intergration with QT
Reply with quote

On 16 March 2018 at 10:18, Ali Ozdin <> wrote:
Quote:
I have set clear mask for hud camera GL_COLOR_BUFFER_BIT in addition to GL_DEPTH_BUFFER_BIT. The problem was solved.

This might be a "solution", but I think it's an indication that
something else is wrong with your setup.

My guess is that your HUD Camera is the only camera being drawn, or
it's the first Camera that is being drawn. If the later then you have
a RenderOrder issue. Have a look at the osghud example for an
illustration of what is required w.r.t setting the Camera RenderOrder
to ensure the overlayed camera gets drawn second, you'll see that only
the GL_DEPTH_BUFFER_BIT is required.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
aozdin
Newbie


Joined: 28 Feb 2018
Posts: 16

PostPosted: Fri Mar 16, 2018 12:39 pm    Post subject:
Re: Intergration with QT
Reply with quote

Dear Robert,

I am examining the oshhud and osgQt examples for 3 days. I also know that only depth buffer is required for osg hud example. I know. But when merge osg hud example with osg qt example it does not work. To get rid of this, I have cleared color buffer there. But in http://forum.openscenegraph.org/viewtopic.php?t=17152 , I could not get rid of this problem by clearing color buffer.
To be clear, I have sent example little source code for these two cases.
Can you help me by taking a look at this sample code on the link http://forum.openscenegraph.org/viewtopic.php?t=17152 ??

robertosfield wrote:
On 16 March 2018 at 10:18, Ali Ozdin <> wrote:
Quote:
I have set clear mask for hud camera GL_COLOR_BUFFER_BIT in addition to GL_DEPTH_BUFFER_BIT. The problem was solved.

This might be a "solution", but I think it's an indication that
something else is wrong with your setup.

My guess is that your HUD Camera is the only camera being drawn, or
it's the first Camera that is being drawn. If the later then you have
a RenderOrder issue. Have a look at the osghud example for an
illustration of what is required w.r.t setting the Camera RenderOrder
to ensure the overlayed camera gets drawn second, you'll see that only
the GL_DEPTH_BUFFER_BIT is required.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12094

PostPosted: Fri Mar 16, 2018 1:25 pm    Post subject:
Intergration with QT
Reply with quote

On 16 March 2018 at 12:39, Ali Ozdin <> wrote:
Quote:
I am examining the oshhud and osgQt examples for 3 days. I also know that only depth buffer is required for osg hud example. I know. But when merge osg hud example with osg qt example it does not work. To get rid of this, I have cleared color buffer there. But in http://forum.openscenegraph.org/viewtopic.php?t=17152 , I could not get rid of this problem by using color buffer.
To be clear, I have sent example little source code for these two cases.

I'm not the author of osgQt or have expertise with Qt so can't help you there.

However, I would recommend you spend a bit more time working on your
understanding of how the various options in osghud - Camera in a scene
graph vs slave Camera, all options should work just fine with an osgQt
based viewer.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Intergration with OSG Lingyun Yu General 1 Tue Mar 17, 2009 4:15 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP