Hi, Koduri If you need to do this precisely, you can use (or write your own) some collision detection algo working with flat 2d polygones (get those by transforming model vertices to screenspace). Also you can get somewhat good results using some stencil buffer magic (the point is to write some distinct value to stencil when both objects are drawn at same pixel, then readback stencil buffer and check if it contains this value).
Cheers, Sergey. 27.08.2012, 10:46, "Koduri Lakshmi" <[email protected]>: > Hi, > > I have two OSG models. The first is constant about rotation and translation > about Z. This model is just translating about X and Y axis. > > The second model is variable about translation and rotation. > > Now I want to call a function when first model come across second model. That > is when first and second models are touch each other I need to call a > function. > > To do this, I calculated the screen coordinates for both models. Formed a > rectangles for both with these coordinates. If these two rectangles intersect > then I called the function. But this not working perfectly as second model is > free about rotation and translation. > > Can any one please help me how to solve this problem. > > ... > > Thank you! > > Cheers, > Koduri > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=49547#49547 > > _______________________________________________ > 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

