You probably don't need to call setFirst(0) every time, but it won't hurt
either.
Also, when dynamically changing geometry this way you need to manage display
lists (either disable them or dirty them when changed) and you need to manage
the bounding volume (either dirty them on change or override the computeBound()
method).
Brian
> Date: Thu, 9 Apr 2009 18:13:07 +0530
> From: [email protected]
> To: [email protected]
> Subject: Re: [osg-users] Dinamic Line Drawing
>
> Hi Sergey,
>
> You need to add your new vertices to the geometry vertex data and
> update the first and size of your primitive set which is drawing the line.
>
> For example
> ========
>
> osg::Geometry* geom // is your geometry
> osg::DrawArrays* drawArrayLines = new
> osg::DrawArrays(osg::PrimitiveSet::LINE_STRIP); // Is your line strip
> Primitive set
>
> geom ->addPrimitiveSet(_drawArrayLines); // Add primitive set
>
> Whenever you have new vertex add the new vertex to the vertex array of
> your geometry and call
>
> drawArrayLines->setFirst(0);
> drawArrayLines->setCount( Num of vertex in your vertex array);
>
>
> I Hope this will help you
>
> cheers
> RJ
>
>
> Sergey wrote:
> > Hi, ALL
> > How can I draw line , and append to this line new vertices (nodes) time
> > after time? For example I need to draw a trajectory of moving object.
> > In examples I have seen only static lines with determined count of vertices.
> >
> > Thank you.
> >
> > ------------------
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=9969#9969
> >
> >
> >
> >
> >
> > _______________________________________________
> > 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
_________________________________________________________________
Quick access to your favorite MSN content and Windows Live with Internet
Explorer 8.
http://ie8.msn.com/microsoft/internet-explorer-8/en-us/ie8.aspx?ocid=B037MSN55C0701A
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org