[osg-users] Can i use MatrixTransform to transform a HUD node?

Terry Welsh mogumbo at gmail.com
Mon Jan 7 21:07:29 PST 2019


>      So you mean that if i want to move or scale these hud nodes on the main screen, i have to use the camera's setviewmatrix method to do this? Add the hud nodes to a new MT and use the Mt transform methods won't work,right?
>
>      The node structure instruction is like the following:
>
>       1. Root->hud node->Mt node->geode node->geometries;
>
>       2. Root->Mt node-> hud node->geode node->geometries;
>
>     So the first one will work and the second won't,right?
>
I have only done #1, where the HUD node is derived from osg::Camera. I
set the view matrix and projection matrix to provide a simple box in
which to render all HUD elements. The individual elements can be
positioned within that box with MatrixTransforms.

It's not very hard to get this working. Try prototyping it with one
osgText::Text element and one simple box or sphere under a
MatrixTransform.

>
> I'm afraid I didn't understand this explanation very well myself. My first
> question would be, do the HUD elements (the 2d pics) stay stuck to the
> screen space (as if they were part of a game scoreboard overlaid onto the
> screen) or do the move around the screen as the main view camera rotates,
> tilts, moves, etc like an Augment Reality environment?
>
Chris, I assumed your first idea. AR labels never crossed my mind.
Maybe Chen can tell us if I made the right assumption.
- Terry


More information about the osg-users mailing list