Hi,
I'm developing a 2D drawing tools , which could draw lines with mouse now. but
I encountered a problem , if want to draw a point , I had to draw two , or draw
another object together , or the first point will not show .
the code is in Line.cpp Line:198 as follows:
Code:
void Line::drawAssistantPoints()
{
char name[30];
for( int i=0 ; i<3 ; i++ )
{
sprintf( name , "vertex_%d_%s" , i , _name.c_str());
_assistantPoints[i]->addDrawable( drawPoint((*_vertexesArray)[i]));
_assistantPoints[i]->addDrawable( drawPoint( (*_vertexesArray)[(i+1)%3]
) );
_assistantPoints[i]->setName(name);
_group->addChild(_assistantPoints[i]);
}
}
'_vertexesArray' store the vertexes and middle point of the line .
the attachment is the code.
Now it could runs fine .
Its functions : first click with the mouse in blank space to choose a point
, second click the get the second point and configure the line . Lines will be
focusd if clicked with its vertexs and middle point lighting .
Please anyone help me to find why the point disappeard ?
Thank you!
Cheers,
lainegates
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=47038#47038
Attachments:
http://forum.openscenegraph.org//files/code_158.rar
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org