Here is what I would do:

1) Create the whole arrow in one geometry including the line - by default
let say make it fixed pointing up (0,0,1). Here is your createArrow thing
that will give you the whole arrow
2) Add MatrixTransform on top of this geometry - with this, you can control
the position, direction and scale
3) Use quaternions for the arrow orientation osg::Quat

This way would not need to rebuilt it for each change

or

build the arrow completely in geometry shader - you would need to pass only
a line this way - only two vertices

-Nick


On Wed, Jun 23, 2010 at 6:32 PM, Gianni Ambrosio <[email protected]> wrote:

> OK, thanks Nick for the explanation & suggestion. At first I started adding
> the geometry to a geode separately but I would like to add the entire arrow
> to the geode instead of adding the two parts. I mean somethig like that:
>
> osg::Geode g;
> g->addDrawable(createArrow());
>
> osg::Geometry* createArrow()
> {
>   // here use createPyramid() and then add the line
> }
>
> Is it possible? I dont like to do as follows:
>
> osg::Geode g;
> g->addDrawable(createPyramid());
> g->addDrawable(createLine());
>
> I mean, I would like to create the arrow as a single geometry but calling
> the createPyramid() method.
>
> Regards
> Gianni
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=29328#29328
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to