HI Sonya,

The osg::LineSegment is just an object for providing a representation of
mathamtical line segment, such as required for intersection testing, it has
no rendering support as it's not indented for this purpose.

The class you want to use is osg::Geometry, have a look at the osggeometry
example to see how to set up lines.

Robert.


On 20 July 2014 17:20, Sonya Blade <[email protected]> wrote:

> Hi All,
>
> I'm planing to use the osg::LineSegment object as rubber line drawer, that
> is, arranging in a way that
> when user clicks at any arbitrary locaiton in screen then it will asign
> the clicked mouse position to
> LineSegment.start()  attribute and when user hoovers the mouse, mouse move
> position will be assigned
> to LineSegment.end() attribute, if user clicks for the 2nd time then
> actual line will be drawn and rubber line
> will disappear.
>
> The problems is: The root node doesn't accept the LineSegment, where
> compiler complains with following line
> "error: no matching function for call to
> 'osg::Geode::addDrawable(osg::ref_ptr<osg::LineSegment>&)'|"
>
> Googling reveals that LineSegment is used generally for the ray casting in
> intersector, it seems that it's not
> suitable for that purpose. In order to clarify that can you shed some
> light on whether the intended task can
> be achieved with LineSegment or not, if not which other way should I use
> to create rubber line?
>
> Regards,
>
>
> _______________________________________________
> 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