[osg-users] Trying to add an osg::CameraNode to a node
Brian
bpdavis at knology.net
Sun Jul 22 19:50:05 PDT 2007
Hi Robert,
Yes, I realize that the description is a bit confusing. Let me try again.
First off, I'm unfortunately not in a position to migrate to version 2 yet.
We have a deadline for the end of August, and we don't believe that we would
be able to do a port between now and then.
As for the RTT question, I'm looking at possibly having to RTT camera nodes.
One would be for the 3D scene and the other would be used to render a
two-dimensional HUD. The HUD's camera node subtree would consist of a
single drawable that would be responsible for rendering the HUD's 2D
symbology.
I've gotten the 3D camera node to work perfectly, but I am unsure as to
whether the second camera node is a good solution for rendering a HUD to
ultimately use as an overlay. I haven't done anything like this before,
and
a camera node was the first thing that came to mind as a potential
solution.
As I think about it, it really doesn't matter whether the 2D camera node is
added to the cockpit or not, and it may be better to have it directly
attached to the main scene node.
This might be an easier explanation of what I'm looking to do. I've looked
at some of the osg examples that render a HUD (osgdelaunay comes to mind.)
However, the ones that I've looked at render directly to the display. What
I need is a way to render that same type of HUD to a texture that could
then
be applied to a 3D quad.
Thanks,
Brian
> ----- Original Message -----
> From: "Robert Osfield" <robert.osfield at gmail.com>
> To: <bpdavis at knology.net>; <osg-users at lists.openscenegraph.org>
> Sent: Saturday, July 21, 2007 4:14 AM
> Subject: Re: [osg-users] Trying to add an osg::CameraNode to a node
>
>
>> HI Brian,
>>
>> I'm afraid I couldn't quite follow the topology of your set up, Is the
>> HUD part of the RTT subgraph?
>>
>> Have you tried out the 2.x series?
>>
>> Robert.
>>
>> On 7/21/07, Brian <bpdavis at knology.net> wrote:
>>> Hi,
>>>
>>> Up until earlier this week, I have successfully used camera nodes to
>>> render a scene to a texture. I would take that texture and pass it to
>>> another function that would render it using straight OpenGL to a 2D
>>> scene. On top of the RTT texture, a transparent overlay would be
>>> applied as a HUD. It worked great, and life was good.
>>>
>>> Recently, I have been given a model that I must now attach the RTT
>>> texture to. I have created a NodeVisitor for the model and have
>>> successfully replaced the node's original texture with the RTT texture.
>>> However, the HUD is no longer rendered as it is not part of the model.
>>>
>>> I think that the best approach would be to use a drawable to render the
>>> HUD, but because the HUD consists of several 2D textures (straight
>>> OpenGL here, no Texture2D objects,) I would like to render the HUD to a
>>> separate texture. Once the rendering completes, I could take the
>>> rendered HUD texture and overlay it on top of the main RTT texture as
>>> before.
>>>
>>> The problem that I'm faced with is how to set up a drawable and
>>> associate a camera node with it so that I can render the HUD to a
>>> texture. I've created a class for the drawable and have added it to the
>>> node visitor's node. I've created a camera node for rendering the HUD.
>>> I cannot however figure out a way to add the camera node to the drawable
>>> so that the scene knows about it. Additionally, I am guessing that the
>>> above additions to the node would not be correct. Instead, I think that
>>> something like...
>>>
>>> node visitor's node
>>> |
>>> camera node
>>> |
>>> drawable
>>>
>>> ... would be more appropriate. The problem is figuring out how to
>>> construct the tree in code.
>>>
>>> Perhaps I am going about this the wrong way? Any thoughts/suggestions
>>> would be greatly appreciated.
>>>
>>> Thanks,
>>> Brian
>>>
>>> _______________________________________________
>>> osg-users mailing list
>>> osg-users at lists.openscenegraph.org
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>>
>>
>
More information about the osg-users
mailing list