[osg-users] problem with dragging in Osg
robert.osfield at gmail.com
Fri Jul 4 01:32:16 PDT 2008
Hi Heishuijing, I presume this is your name, in future could you sign
your emails with your name so we know who to address. Thanks.
As for what is causing the crash, with such little info, and no stack
trace is at best clutching at staws. My guess guess would that it's
threading issue, where you viewer is running DrawThreadPerContext and
your own code is modifying Geometry without setting the DataVariance
of it to DYNAMIC. Set the vewier to SingleThreaded to test this
On Fri, Jul 4, 2008 at 3:42 AM, heishuijing_2000
<heishuijing_2000 at 126.com> wrote:
> Recently,i have a problem about dragging in Osg. I want to drag one
> surface of a box and make the box modified. During i am dragging,i modify
> the box constantly.Here what i do.
> 1. I define a class as this: class ModifyClass : public
> 2. In this function , virtual bool handle(const osgGA::GUIEventAdapter&
> ea,osgGA::GUIActionAdapter& aa)
> i write a function 'DoDrag' to process the osgGA::GUIEventAdapter::DRAG
> 3. In the 'DoDrag' function,i compute the surface's points from mouse's
> drag,and then modify the surface and other 3 surfaces which is affected by
> the Dragging. Here is what i do:
> // m_selectedFace is the selected geometry face
> // p1 p2 p3 p4 are the points of the surface
> osg::Vec3Array* surfaces = dynamic_cast< osg::Vec3Array* >(
> m_selectedFace->getVertexArray() );
> this->setVertexArray( surfaces );
> this->setPrimitiveSet( 0, new osg::DrawArrays(
> osg::PrimitiveSet::POLYGON, 0, surface_ver->size() ) );
> At first ,this does perfect,with my dragging ,the box is changed
> constantly.Unfortunately, after a short time,it is crashed with exception
> error,and then the programe is stopped.
> I was working with VS2003 and osg2.4 . I really want to know what is the
> error,and what should i do?
> Anyone help me? Thank you!
> osg-users mailing list
> osg-users at lists.openscenegraph.org
More information about the osg-users