eatpepsi wrote: > > Max wrote: > > Hi, > > > > > > eatpepsi wrote: > > > > > > 2)Considering second question I want to find texture coordinate of a > > > particular point on the model.Using picking I can find the 3d position of > > > an object,Similarly can I get the assigned texture coordinates at an > > > arbitrary point using osg??This is similar to contactTexCoord(MFVec3f) in > > > H3D. > > > > > > > > > Thank you! > > > > > > Cheers, > > > Tim > > > > > > Do you mean: > > " I have a model already textured with a texture mapping, I'd like to find > > the uv texture coordinates for any point, vertex or not." > > ? > > > > Max > > > Yes This is what I exactly want to do.
There surely are several ways to do this. There is one I can see right now, probably not the fastest one. With the picking you can retrieve the geode which your point lies inside and your point's coordinates. As you know: - the texture's coordinates of every vertex - your point belongs to a polygon - your point's uv coordinates are just an interpolation over the vertices' uv coordinates of the polygon containing your point. All you have to do is finding: - the interpolation formula (probably just based on the geometric center of the polygon) - the polygon For the polygon you can scan all primitiveset and make a "belonging test". You can find one here (http://www.enseignement.polytechnique.fr/profs/informatique/Philippe.Chassignet/03-04/INF_431/td_16.html) at exercise 4 (it's in french). It is a handy way to do. Before trying it, make sure you have done a good scan of this forum, the wiki, the doxygen and the net ;). Good luck, Max ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=15228#15228 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

