Ignore:
Timestamp:
Mar 24, 2012, 10:00:11 AM (12 years ago)
Author:
Torben Dannhauer
Message:

The intersection works and the selector highlighter is set and displayed correctly.
Next steps:

  • use a variable to control whether distortion setup is active or not. temporarily track the Ctrl Key to enably(push or disable(release) the edit mode.
  • Hide the highlighter and disable the intersection/drag tracking on diabled edit mode.
  • catch up dragging values and translate them in the correct coordinate frame.
  • apply dragging values:
  • a) either on the texture coordinate while the grid is constant,
  • b) or apply them on the grid node coordinates while the texture coordinates are constant (check/compare solutions!)



File:
1 edited

Legend:

Unmodified
Added
Removed
  • experimental/distortionNG/distortionNG.cpp

    r339 r340  
    5252                if ( viewer )
    5353                {
    54                         osg::ref_ptr<osgUtil::LineSegmentIntersector> intersector = new osgUtil::LineSegmentIntersector(osgUtil::Intersector::WINDOW, ea.getX(), ea.getY());
     54                        osg::notify(osg::ALWAYS)<<std::endl<<"Intersection:"<<std::endl<<"ea.getX()="<<ea.getX()<<std::endl;
     55                        osg::notify(osg::ALWAYS)<<"ea.getY()="<<ea.getY()<<std::endl;
     56                        osg::ref_ptr<osgUtil::LineSegmentIntersector> intersector = new osgUtil::LineSegmentIntersector(osgUtil::Intersector::PROJECTION, ea.getX(), ea.getY());
    5557                        osgUtil::IntersectionVisitor iv( intersector.get() );
    5658                        //viewer->getCamera()->accept( iv );
     
    6769        if ( ea.getEventType() == osgGA::GUIEventAdapter::DRAG  )
    6870        {
    69         osg::notify(osg::ALWAYS)<<std::endl<<"ea.getGraphicsContext()="<<ea.getGraphicsContext()<<std::endl;
     71                osg::notify(osg::ALWAYS)<<std::endl<<"Drag:"<<std::endl<<"ea.getGraphicsContext()="<<ea.getGraphicsContext()<<std::endl;
    7072        osg::notify(osg::ALWAYS)<<"ea.getXnormalized()="<<ea.getXnormalized()<<std::endl;
    7173        osg::notify(osg::ALWAYS)<<"ea.getYnormalized()="<<ea.getYnormalized()<<std::endl;
     
    112114                                closestVertexIndex = result.indexList[i];
    113115                        }
    114                 //      OSG_NOTIFY(osg::ALWAYS)<<"maxRatio="<<maxRatio<<std::endl;
    115                 //      OSG_NOTIFY(osg::ALWAYS)<<"closestVertexIndex="<<closestVertexIndex<<std::endl;
     116                        OSG_NOTIFY(osg::ALWAYS)<<"maxRatio="<<maxRatio<<std::endl;
     117                        OSG_NOTIFY(osg::ALWAYS)<<"closestVertexIndex="<<closestVertexIndex<<std::endl;
    116118                }
    117119                OSG_NOTIFY(osg::ALWAYS)<<"nearest vertex: X="<<(*vertices)[closestVertexIndex].x()<<" Y="<<(*vertices)[closestVertexIndex].y()<<" Z="<<(*vertices)[closestVertexIndex].z()<<std::endl;
Note: See TracChangeset for help on using the changeset viewer.