hi, i would like to extend the example-program "osgforest" in a way so that the placement of trees becomes user-controllable via an additional raster mask. in detail: a 1bit rasterfile should mark treeless areas with a value of "0" and tree-covered areas with a value of "1". subsequent this mandatory partitioning, i would like use the existing, random placement of trees in tree-covered areas.
i'm new to osg, so i have a few questions about how to implement this, and would also be happy to get some clues from you. * can i use a simple osg::texture2D (nearest neighbour worldcoordinate scaled to osgforest's terrain extent), as raster mask? * if yes, how can i query/access a raster value at a specific texture coordinate? * how can i prevent that the raster mask will be rendered in the final scene? (would a nodemask be the right way, or are there any better/simpler ways?) * in this first approach i will only implement 2 different tree regions: covered and non-covered. my plan is to extend to the existing "createTreeList" function with a simple check for the raster mask value at the randomly generated tree position coordinates. only if it happens to lie inside a tree-covered area, the tree will be pushed into the trees list. maybe someone knows a more elegant way? best regards, christian ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=7664#7664 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

