If you want to just move the position of a texture on a fixed geometry,
an alternative is to use a TexMat node (texture matrix) that will be
multiplied with the texture coordinates. Updating is done just as
Thibault suggested, with a callback.
To see it in action check osgtexturerectangle example.
Mihai
Calin Negru wrote:
Thanks!
On 3/6/07, Thibault
Genessay <[EMAIL PROTECTED]> wrote:
Hi
Calin
On 3/7/07, Calin Negru <
[EMAIL PROTECTED]> wrote:
How
can I get 2D images moving on the screen? I managed to display a
static HUD however I can't figure out how to get the cursor graphics
moving on screen. I took glance at osgcatch but the code is
too complicated (and I'm looking for a quick fix ).
To set the HUD position on the screen I feed a osg::geometry
object with a coordinates array. Is there a way to move the
geometry position at runtime?
You can just add your geode - the one that contains your
geometry - as a child of a MatrixTransform or
PositionAttitudeTransform. Then moving your HUD around only takes a
change in the Matrix/Vec3-Quat of the transform node. You have to do
this change during the update() phase of the main loop; using an update
callback is probably the best way. Have a look at the osggeometry
example: it has a moving background that uses this technique.
--
Thibault
--
Calin Negru
|
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/