Hi,

I have again basic question which is related to my previous one about terrain 
editing. I can create terrain with lot of tiles, so now i want to have 
posibility to choose particular tile by picking it. The way i tried to 
implement is something like that:

1. create osgTerrain object 
2. add TerrainTiles objects to terrain
3. create node visitor and pass terrain to it (terrain->accept)
4. in visitor apply(osg::Geode) method i'm creating 
osgUtil::LineSegmentIntersector and osgUtil::IntersectionVisitor objects
5. passing visitor to view camera. 

And as i understand my terrain visitor visits all tiles of my terrain and then 
inside terrain visitor apply method intersection visitor visits all visible 
nodes of the scene testing intersection, what sounds for me as a little 
nonsense. How to do it properly? I would like to do in such way:

1. 1. create osgTerrain object 
2. add TerrainTiles objects to terrain
3. create node visitor and pass terrain to it (terrain->accept)
4. in terrain visitor apply(osg::Geode) method i want to check if pick ray is 
intersecting my geode.

But how to get pick ray? I found something like osgUtil::PickVisitor, but i'm 
not sure how to use it. Could somebody help with that?

Thank you!

Cheers,
Robert

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=32873#32873





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to